fatiguee fatiguee
  • 22-09-2021
  • Computers and Technology
contestada

C program to input the ages of five students and display their ages in reverse order.

Respuesta :

bentonparrish1220
bentonparrish1220 bentonparrish1220
  • 22-09-2021
#include
int main()
{
int age;
int cnt_baby=0,cnt_school=0,cnt_adult=0;
int count=0;

while(count<15)
{
printf("Enter age of person [%d]: ",count+1);
scanf("%d",&age);

if(age>=0 && age<=5)
cnt_baby++;
else if(age>=6 && age<=17)
cnt_school++;
else
cnt_adult++;

//increase counter
count++;
}

printf("Baby age: %d\n",cnt_baby);
printf("School age: %d\n",cnt_school);
printf("Adult age: %d\n",cnt_adult);

return 0;
}
Answer Link

Otras preguntas

30 POINTS + BRAINLIEST MARK → What is the likelihood that an organism will produce a male offspring and why?
Give the required elements of the hyperbola. 4x^2 - y^2= 16 The value of b is:
what type of figurative language is this let your "heart be light" plzzzzzz help
Tycho brache was a danish scientists who built one of the first modern, observations known as Iraniborg
Witch of the following words is not and adverb A more B perhaps C too D two
given f(x)=4x-18 solve for the following f(-3) and f(x)=-46 write the two as an ordered pair PLEASE HELP
Please help mehhhjhh
In what way was Truman's decision to use the atomic bomb MOST influenced by his predecessor, Franklin D. Roosevelt? A) Roosevelt promised victory by unconditio
Every verb has blank principle parts
Please help mehhhjhh