C Language Example # 50 Series Example # 02 Display Odd numbers Series.
* This program is example of simple odd number series and even number series.
* This program is example of simple odd number series and even number series.
//Written by : Latest Technology Guide
//Title : C Language Example # 50 Series Example # 02 Display Odd numbers Series.
//Title : C Language Example # 50 Series Example # 02 Display Odd numbers Series.
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int sum=1,n,i;
printf("Enter Number of Terms :");
scanf("%d",&n);
printf("\n\n ****** 1st Method **********\n\n");
for(i=1;i<=n;i=i+2)
{
printf(" %3d ",i);
}
printf("\n\n ****** 2nd Method **********\n\n");
for(i=1;i<=n;i++)
{
sum = sum + 2;
printf(" %3d ",sum);
}
getch();
}
#include <conio.h>
void main()
{
clrscr();
int sum=1,n,i;
printf("Enter Number of Terms :");
scanf("%d",&n);
printf("\n\n ****** 1st Method **********\n\n");
for(i=1;i<=n;i=i+2)
{
printf(" %3d ",i);
}
printf("\n\n ****** 2nd Method **********\n\n");
for(i=1;i<=n;i++)
{
sum = sum + 2;
printf(" %3d ",sum);
}
getch();
}
Output:
--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 50 Series Example # 02 Display Odd numbers Series.
* Program will display odd number series.
Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements.
Thanks this nice post about c programming. Data Types in C Programming .
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteVery wonderful informative article. I appreciated looking at your article. Very wonderful reveal. I would like to twit this on my followers. Many thanks!
ReplyDeletebulletintech
how tall is dababy
henry sedgwick v
justdubs
citra emulator apk
frank rocky fiegel
how to program rca universal remote
taylor olsen
natalie 90 day fiance