(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-2960223314593660",
enable_page_level_ads: true
});
Program to print all natural numbers from 1 to n. - TecGlance
Header Ads
Home/Programs/Program to print all natural numbers from 1 to n.
Write a C program to print all natural numbers from 1 to n using for loop.
Code of given problem:
int main() { int i=1,n; printf("Enter the number to print all natural number till that entered number\t"); scanf("%d",&n); for(i=1;i<=n;i++) { printf("%d\t",i); } return 0; }
Write a C program to print all natural numbers from 1 to n using for loop.
ReplyDeleteCode of given problem:
int main()
{
int i=1,n;
printf("Enter the number to print all natural number till that entered number\t");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("%d\t",i);
}
return 0;
}
Very informative blog!
Please take some time to visit my blog @
for loop program examples
Thanks!
good boy malan
ReplyDelete