C Program For MAKING NUMBER SERIES
Loops are group of instructions executed repeatedly while certain condition remains true. There are two types of loops, counter controlled and sentinel controlled loops (repetition). Counter controlled repetitions are the loops which the number of repetitions needed for the loop is known before the loop begins; these loops have control variables to count repetitions. Counter controlled repetitions need initialized control variable (loop counter), an increment (or decrement) statement and a condition used to terminate the
loop (continuation condition).

CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,t=0,a[10];
clrscr();
printf("Enter the n value");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Enter the a[%d]=",i);
scanf("%d",&a[i]);
}
for(i=1;i<=n;i++)
{
t=t*10+a[i];
}
printf("the series is=%d",t);
getch();
}
0 comments:
Post a Comment