Advertisement
touhid_xml

Loops in C

Jul 14th, 2015
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.    int i;
  5.    /** for(i=1;i<=10;i++){
  6.        printf("The number is: %d\n",i);
  7.     } **/
  8.  
  9.     i = 1;
  10.  
  11.     /**while(i<=100){
  12.             printf("The number is: %d\n",i);
  13.             //i++;
  14.     i = i + 1;
  15.     } **/
  16.  
  17.     do{
  18. printf("The number is: %d\n",i);
  19.             //i++;
  20.     i = i + 1;
  21.  
  22.     }while(i<=100);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement