Tuesday, January 29, 2013

C Language Example # 12 For Loop Example : Display Numbers Up to N Terms

C Language Example # 12 For Loop Example : Display Numbers Up to N Terms.

Lets now starts with Looping Structure of C Programming Language.


C Language Code:

//Written by Latest Technology Guide    
//Title : Example 12 : For Loop Example : Display Numbers Up to N Terms.
  
#include <stdio.h>
#include <conio.h>


void main()
{
clrscr();

int n,i;

printf("Enter Number of Terms : ");
scanf("%d",&n);

for(i=1;i<=n;i++)
printf("%d ",i);

getch();
}


Output:

We think there is no need of Output for this program.


--------------------------------------------------------------------------------
Explanation of C Language Example  # 12 For Loop Example : Display Numbers Up to N Terms..

* Enter value for Number of Terms as N.
* This C Program will will display numbers from 1 to upto N Terms.

Still having doubts you can post comment, will explain in details.

Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

1 comment:

  1. thank you for sharing nice article in your blog
    visit
    web tutorial programming
    https://www.welookups.com

    ReplyDelete