Home » C Programs » C Program to Print Hello World 10 Times

C Program to Print Hello World 10 Times

A computer program that outputs or displays the message “Hello, World!” is known as a “Hello, World!” program. In most programming languages, such a program is very simple, and it is frequently used to demonstrate a programming language’s basic syntax.

For Loop Definition

A for loop is a repetition control structure that allows us to create a loop that runs a set number of times. The loop allows us to perform an arbitrary number of steps in a single line. A loop is used to repeatedly execute a set of statements until a certain condition is met. Using this for loop we have executed the c program to print hello world 10 times 

Pre Increment and Post Increment in C

The pre-increment and pre-decrement operators raise or lower the object’s value and return a reference to the result. After incrementing or decrementing the object’s value, post-increment and post-decrement creates a copy of the object, increments or decrements the object’s value, and returns the copy from before the increment or decrement.

Return Statement in C

A return statement marks the end of a function’s execution and hands control back to the calling function. The calling function resumes execution at the point where the call was made. A return statement can give the calling function a value. 

C Program to Print Hello World 10 Times

//C Program to Print Hello World 10 Times
#include<stdio.h>
int main()
{
int n,i;
printf("Enter a number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{ 
printf("Hello World\n ");
}
return 0;
}

Output:

Enter a number 10
Hello World
Hello World
Hello World
Hello World
Hello World

Hello World
Hello World
Hello World
Hello World
Hello World