Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int main()
- {
- int i,luckynum,num;
- srand(time(NULL));
- printf("Adivinhe um numero no intervalo de 1 a 10:\n");
- scanf("%d",&num);
- luckynum = rand() % 10 + 1;
- if (num == luckynum)
- {
- for (i = 0; i < 100; i++)
- {
- printf("QUE SORTE!\n");
- }
- }
- else
- {
- printf("ERRADO, o numero sorteado foi %d!\n",luckynum);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment