//How to print first N natural numbers using C language

How to print first N natural numbers using C language

Q) Write C program to print first N natural numbers ?

 


#include<stdio.h>
int main(void)
{
int n,i;
printf("Enter no of natural numbers you want to print\n");
scanf("%d",&n);
printf("First N natural numbers are : ");
for(i=o;i<n;i++)
{
printf("%d ",i);
}
return 0;
}
OUTPUT :

Enter no of natural numbers you want to print
5
First N natural numbers are : 0 1 2 3 4


Related Post :  Addition of two numbers

If any one intrested to post something stuff that you done , you can freely post by just registering  in our website   http://www.learningbuz.com/create-post/  and you can expose your stuff to the world