answersLogoWhite

0

#include<stdio.h>

main(void)

{

int n;

int i;

printf("Type n: ");

scanf("%d",&n);

for(i=1;i<=n;i++) //generates natural numbers from 1,....,n.

printf("%d\n",i); //prints these numbers to standard output

}

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

Write a java program using forloop to generate the first 10 multiples of the first 10 natural numbers?

Here's a simple Java program that uses a for loop to generate the first 10 multiples of the first 10 natural numbers: public class Multiples { public static void main(String[] args) { for (int i = 1; i &lt;= 10; i++) { System.out.print(&quot;Multiples of &quot; + i + &quot;: &quot;); for (int j = 1; j &lt;= 10; j++) { System.out.print(i * j + &quot; &quot;); } System.out.println(); } } } This program iterates through the first 10 natural numbers and prints their multiples from 1 to 10.


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


To generate first 10 Armstrong numbers?

which r the first 10 amstrong numbers??


What is the program to calculate the average of first 'n' natural numbers?

printf ("%g\n", (n+1.0)/2);


How do you write a program to find out the square and cube of first ten natural numbers in gw basic?

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.


Write a program to generate the first 50 perfect numbers?

I don't believe that 50 perfect numbers have ever been found, last time I checked there were only about 47 known perfect numbers. It would also require an extremely powerful computer.


What is the smallest multiple of the first ten natural numbers?

2520 is the smallest multiple of of first ten natural numbers.


What is the sum of 50 natural numbers?

The sum of the first 50 natural numbers is 1,251.


The variance of first n natural numbers is?

1 Sum of first n natural numbers = n(n+1)2[Formula.]2 Arthmetic mean of first n natural numbers = Sum of the numbers n[Formula.]3 = n(n+1)2n = n+124 So, the Arthmetic mean of first n natural numbers = n+12


What is the product of the first five natural numbers?

Good question. 1+2+3+4+5=155=15 So the product of first five natural numbers is fifteen Natural numbers starts from one So we add first five natural numbers and get the right answer is fifteen


What is sum of natural numbers between 200?

The sum of the first 200 natural numbers is 20,001.


What is the first natural numbers?

123456789101112131415.