Pages

Sunday, 20 May 2012

While Loop tutorials


While Loop tutorials
75./*Write a program to print this series:-
         1 3 5 7 9 11 13 15 17 19 21 23 25 ………… 99.*/

#include<stdio.h>
#include<conio.h>
main()
{
            int i=1;
            clrscr();
            while(i<=100)
            {
             printf("%d\t",i);
             i=i+2;
             }
             getch();
}

OUTPUT

           
            1 3 5 7 9 11 13 15 17 19 21 23 25 ………… 99

No comments:

Post a Comment