Advertisement
shamiul93

1118

Jan 30th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.59 KB | None | 0 0
  1. #include<stdio.h>
  2. main()
  3. {
  4.  
  5.     int x=1;
  6.     double a,s=0;
  7.     int c=0;
  8.     r: s=0;
  9.     c=0;
  10.     if(x==1)
  11.     {
  12.         while(c<2)
  13.         {
  14.             scanf("%lf",&a);
  15.             if(a>=0&&a<=10)
  16.             {
  17.                 c++;
  18.                 s=s+a;
  19.             }
  20.             else
  21.                 printf("nota invalida\n");
  22.         }
  23.         printf("media = %.2f\n",s/2);
  24.  
  25.     }
  26.  
  27.    f: printf("novo calculo (1-sim 2-nao)\n");
  28.     scanf("%d",&x);
  29.  
  30.    if(x==1)
  31.         goto r;
  32.      else if(x==2)
  33.         goto h;
  34.     else
  35.             goto f;
  36.     h:return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement