[ create a new paste ] login | about

Link: http://codepad.org/kY18UGae    [ raw code | output | fork ]

C, pasted on Oct 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
   #define PI 3.14
int main()
{ float  r ,s , l;  
 printf("please input r:\n");
 scanf("%f",&r);
	if (r>=0)                        
	  {s=PI*r*r;
      l=2*PI*r ;
	  printf("the area is %f\n",s);	
printf("the circumference is %f\n",l);}
else  
printf("input error!\n"); 
 }  


Output:
1
2
3
4
please input r:
input error!

Exited: ExitFailure 13


Create a new paste based on this one


Comments: