Answer to Question #343831 in C for Kenken

Question #343831
  1. Input a positive integer.
  2. Using while() loop, repeatedly print out the message "CodeChum is awesome" for the same number of times as that of the inputted integer. Each outputted message must be separated in new lines.
  3. Don't forget to make an increment/decrement variable that will increase its value per iteration so as to not encounter a forever loop and have errors, okay?
1
Expert's answer
2022-05-22T18:09:30-0400
#include <stdio.h>


int main()
{
	int num;

	printf("Enter a number: ");
	scanf("%d", &num);
	while (num > 0)
	{
		printf("CodeChum is awesome\n");
		num--;
	}

	return 0;
}

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
APPROVED BY CLIENTS