#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
int n,i,a,d,c;
printf("enter first term=\tenter common difference=\tenter no of terms=\t");
scanf("\t%d\t%d\t%d",&a,&d,&i);
for(n=1;n<=i;n++)
{ c=a+(n-1)*d;
printf("%d\t",c);
}
getch();
}
#include<conio.h>
void main()
{ clrscr();
int n,i,a,d,c;
printf("enter first term=\tenter common difference=\tenter no of terms=\t");
scanf("\t%d\t%d\t%d",&a,&d,&i);
for(n=1;n<=i;n++)
{ c=a+(n-1)*d;
printf("%d\t",c);
}
getch();
}
Very nice effort...printf is short and logic aacha hai
ReplyDeleteThanks for comments
Delete