-->
Showing posts with label to print/display 1. Show all posts
Showing posts with label to print/display 1. Show all posts

program to print/display 1,6,11,16....nth term.

//program to print/display 1,6,11,16....nth term.
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,n;
printf("enter value of 'n'\n");
scanf("%d",&n);
while(k<=n)
   {
      printf("%d,",k);
      k=k+5;
   }
getch();
}