fork download
  1. #include<stdio.h>
  2. #include<stdio.h>
  3. void main()
  4. {
  5. char ch;
  6. printf("Enter your choice:\n 1.circle\n 2.rectangle\n");
  7. scanf("%c",&ch);
  8. float r,l,w,a;
  9. if(ch=='1'){
  10. printf("input :> r = ");
  11. scanf("%f",&r);
  12. a=3.14159*r*r;
  13. printf("area of circle :> %f\n",a);
  14. }
  15. else if(ch=='2') {
  16. printf("Input length and width:> ");
  17. scanf("%f%f",&l,&w);
  18. a=l*w;
  19. printf("area of rectangle :> %f\n",a);
  20. }
  21.  
  22. }
  23.  
  24.  
Runtime error #stdin #stdout 0s 2172KB
stdin
Standard input is empty
stdout
Enter your choice:
 1.circle
 2.rectangle