click on this link......

LinkGrand.com

Friday 11 January 2013

To print series 1 to n using 'for' loop

#include<stdio.h>
#include<conio.h>
void main()
{
             int i,num;
            printf("Enter the last number:");
           scanf("%d",&num);
             for(i=1;i<=num;i++)
             {
                      printf("\n%d",i);
            }
            getch();
}

program to print series from 1 to n using for loop
program to print series from 1 to n using for loop

output for series from 1 to n using for loop
output for series from 1 to n using for loop
       

No comments:

Post a Comment