1.//Program to print area and perimeter of a circle
#include<iostream.h> #include<conio.h> void cal(int R) { cout<<The area of circle is<<3.14*R*R; cout<<\nThe perimeter of circle is<<2*3.13*R; } void main() { clrscr(); int r; cout<<Enter the radius of the circle; cin>>r; cal(r); getch(); }
2.//Program to Display greater of 3 numbers #include<iostream.h> #include<conio.h> 2
void comp(int A,int B,int C) { if(A>B && A>C) { cout<<A<<is greatest; } else if(B>C) { cout<<B<<is greatest; } else cout<<c<<is greatest; } void main() { int i,j,k; cout<<Enter 3 numbers you want to compare; cin>>i>>j>>k; comp(i,j,k); }