Display first 10 numbers in c

 C program to display first 10 numbers

code:

#include<stdio.h>
int main()
{
int i;
printf("first 10 numbers");
for(i=1;i<=10;i++)
{
printf("\n%d",i);
}
return 0;
}



Explanation:

Simple and easy program to understand

Step 1: Declare the variable using a datatype(int, float, char)

Step 2: Printing the statement to know what we are going to do.

Step 3: Using a for loop to iterate it ,so that the first ten numbers get printed.

Step 4: The 10 numbers should be printed so we are using printf statement to print all those "first 10 numbers" ,to printf the numbers one by one we use newline character"/n".



Output:



Comments

Popular posts from this blog

Use of Backslash "\n" in C language

COHESION AND COUPLING material

Coding and Testing in software engineering