Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- main()
- {
- int x=1;
- double a,s=0;
- int c=0;
- r: s=0;
- c=0;
- if(x==1)
- {
- while(c<2)
- {
- scanf("%lf",&a);
- if(a>=0&&a<=10)
- {
- c++;
- s=s+a;
- }
- else
- printf("nota invalida\n");
- }
- printf("media = %.2f\n",s/2);
- }
- f: printf("novo calculo (1-sim 2-nao)\n");
- scanf("%d",&x);
- if(x==1)
- goto r;
- else if(x==2)
- goto h;
- else
- goto f;
- h:return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement