Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<time.h>
- #include<stdlib.h>
- void main(void)
- {
- int addendo1,addendo2,somma;
- srand(time(NULL));
- addendo1=rand()%100;
- srand(time(NULL)+1);
- addendo2=rand()%100;
- printf("quanto fa %d + %d ? \n",addendo1,addendo2);
- scanf("%d \n",&somma);
- if (somma==addendo1+addendo2)
- {
- printf("risultato corretto!");
- }
- else
- {
- printf("risultato errato, il risultato corretto è %d",addendo1+addendo2);
- }
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement