Skip to main content

series iteration 2

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,lim,num=1;
printf("Enter the limit:");
scanf("%d",&lim);
for(i=1;i<=lim;i++)
{
printf("%d",num);
if(i%2==0)
num+=4;
else
num+=2;
}
getch();
}

Comments

Popular posts from this blog