Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- #define N 50
- int main(){
- int sorteado;
- srand(time(NULL));
- int i=0;
- while(i<=50){
- sorteado=(rand()%100)+1;
- printf("%d\t",sorteado);
- i++;
- }
- printf("vamos ver agora com o for!\n\n");
- for(i=0;i<=50;i++){
- sorteado=(rand()%100)+1;
- printf("%d\t",sorteado);
- }
- printf("agora com o do while!\n\n");
- i=0;
- do{
- sorteado=(rand()%100)+1;
- printf("%d\t",sorteado);
- i++;
- }
- while(i<=50);
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment