Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<time.h>
  3. #include<stdlib.h>
  4. void main(void)
  5. {
  6. int addendo1,addendo2,somma;
  7. srand(time(NULL));
  8. addendo1=rand()%100;
  9. srand(time(NULL)+1);
  10. addendo2=rand()%100;
  11.  
  12. printf("quanto fa %d + %d ? \n",addendo1,addendo2);
  13. scanf("%d \n",&somma);
  14.  
  15. if (somma==addendo1+addendo2)
  16. {
  17. printf("risultato corretto!");
  18. }
  19. else
  20. {
  21. printf("risultato errato, il risultato corretto รจ %d",addendo1+addendo2);
  22. }
  23. printf("\n");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement