Saturday, July 2, 2016

C Program to print series 10 20 30 40 50 ... N

C Program to print series 10 20 30 40 50 ... N for the given value of N.


For example, if N=5, output should be
10 20 30 40 50



#include<stdio.h>
void main()
{
 int i, N;
 printf("Enter N:");
 scanf("%d", &N);

 for(i=1; i<=N; i++)
 {
     printf("%d ",i*10);
 }
}


Output of program

Enter N:5
10 20 30 40 50

No comments:

Post a Comment