Sep
29

WAP in C++ to print surface area of cylinder.

By admin  //  C++  //  View Comments

Here is a program to print surface area of cylinder. This program asks user to input radius and height of Cylinder.
Don’t forget to define “PI” before void main.

#include <iostream.h>
#include <conio.h>
#define pi 3.1415
void main()
{
int a, r, h;
cout<<”Enter the radius & height of the cylinder”<<endl;
cin>>r>>h;

a=2*pi*r*h;
cout<<”The surface area of cylinder is “<<a<<endl;
getch();
}

Related posts:

  1. my first program in C++
  2. Adding two integers in C++
  • http://stevenswood.com/ Steve Waugh

    Critical to understand. But
    I’m trying for understand the program as well as I expect. Thanks mate and have
    a nice read.
     

  • Reya Thakur
blog comments powered by Disqus