Huwebes, Oktubre 13, 2011

 
          Write a program that asks the user to enter a number n and display the first n odd numbers. Example: if n=5, the first 5 odd numbers are 1, 3, 5, 7 and 9.


     #include<stdio.h>
     #include<conio.h>
     #define min printf
     #define jee scanf

     int main()
     {
         int m, j;
   
         min("Enter a number: ");
         jee("%d",&j);
   
              for (m=1;m<=j*2;m+=2)
                 {
                 min("%d\n",m);
                 }
         getch ();
         return 0;
     }
                                                                     Sample Output:


                                                                         ▌▌▌Ü ▌▌▌

Walang komento:

Mag-post ng isang Komento