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.
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;
}
Comments
Leave a comment