Hi.I am stuck on this question for a week .i need alil help from you guys....
This question is taken from the book ( C How to program 3/e by Deitel & Deitel) from the chapter 3 , question 3.38.
3.38 Write a program that prints 100 asterisks, one at a time. After every tenth asterisk, your program should print a newline character. (Hint: Count from 1 to 100. Use the modulus operator to recognize each time the counter reaches a multiple of 10.)
Above is the question .To make the question more clear hear is what the output should be for the program.
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
Above is the output for the program .Below is the code i wrote for this Question.
#include <stdio.h>
int main()
{
int cnt;
cnt =0;
clrscr();
while ( ++cnt <= 100 ){
printf ("*");
if ( cnt == 10 )
printf ("\n");
cnt = 0
}
return 0;
}
My programm is giving me an infinite loop.
Thanks alot