when every without using loop any one asking. That means we have to give answer using recursion.
int print_done_without_loop(unsigned int times){
if(times){
printf("DONE\n");
print_done_without_loop(times-1);
}
}
Full Code
#include < stdio.h >
int print_done_without_loop(unsigned int times){
if(times){
printf("DONE\n");
print_done_without_loop(times-1);
}
}
int main(int argc, char *argv[]){
print_done_without_loop(100);
return 0;
}
Compile and OUT PUT
rajesh@ideapad:~/Rajesh/Blog$ gcc print_done.c
rajesh@ideapad:~/Rajesh/Blog$ ./a.out
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
DONE
No comments:
Post a Comment