C Program to Print First n Numbers using For Loop

Write a Program to Print First n Numbers using For Loop

// C Program to Print First n Numbers using For Loop

#include <stdio.h>

int main()
{
	int n;

	printf("Enter Number :--> ");
	scanf("%d", &n);

	int i;


        printf("\nFirst %d Numbers :--> ", n);
	for(i=1; i<=n; i++)
	{
		printf(" %d ", i);
	}

	return 0;
}

Output:

Enter Number :--> 10

First 10 Numbers :-->  1  2  3  4  5  6  7  8  9  10

≪ Previous | Next ≫