Monday 23 June 2014

43)write a program to evaluate and display the volume of a cyclinder given its area and height.

#include<iostream>
using namespace std;
#define PI 3.14
int main()
{ float radius,height,volume;
  cout<<"enter radius of cylinder  "<<endl;
  cin>>radius;
  cout<<"enter height of cylinder  "<<endl;
  cin>>height;
  volume=PI*radius*radius*height;
 cout<<"the volume of cylinder is "<<volume;
}

No comments:

Post a Comment

Write a program which reads a set of integers into an integer array and then prints "YES"if all of them are same otherwise print "NO".

#include<stdio.h> int main() { int a[10],M=0,i,n; printf("enter a value for n\n"); scanf("%d",&n); fo...