Answer to Question #245678 in C for ABHI

Question #245678

Sometimes we want some part of our code to be executed more than once. We can repeat the code in our program. For example, we need to display our name for a hundred or more times it is not practical to write the same code. Which concept will be used? Explain it with the help of suitable example


1
Expert's answer
2021-10-02T07:53:56-0400

It's loops. Example:

prints 10 times "Hello!"

for (int i = 0; i < 10; i++) {
	printf("Hello!\n);
}

Other constructions:

  • while(condition) {}
  • do {} while (condition);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS