Question: This is supposed to be starting at 1 and increasing to stop at the users age they enter but it goes into an infinite loop

This is supposed to be starting at 1 and increasing to stop at the users age they enter but it goes into an infinite loop and I cant figure out why in my Programming course.

#include

int main()

{

int age;

int counter;

printf(" Please type in your age. ");

scanf(" &b", &age);

for (counter = age; counter >= age; counter++)

{ printf(" Happy Birthday! (year %d) ", counter); }

while (age > counter);

return;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!