Reginaldojs

exercicio 7,lista 3

May 2nd, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. int main(){
  5.          int sorteado;
  6.          srand(time(NULL));
  7.          sorteado=(rand()%10)+1;
  8.          int chute;
  9.          printf("adivinhe um numero de 1 a 10:");
  10.          scanf("%d",&chute);
  11.          if(chute==sorteado){
  12.             int i;
  13.             for(i=0;i<100;i++){
  14.             printf("sortudo kkk");
  15.             }
  16.          }
  17.          else
  18.             printf("errado,o numero sorteado foi %d",sorteado);
  19.          return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment