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 num, gerador, i;
- srand(time(NULL));
- printf("\nInforme um numero de 1 a 10: ");
- scanf("%d", &num);
- gerador = rand() % 10;
- if(num == gerador)
- {
- for(i = 0; i < 100; i++)
- printf("\nQue Sorte!!");
- }
- else
- printf("\nErrado, o numero sorteado foi %d\n", gerador);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment