68 774
Assignments Done
Successfully Done
In January 2019

Answer to Question #67789 in C for abdul

Question #67789
A C program is needed for Children Camping Registration Day. The program has one user-defined function named Event( ). This function will ask 2 inputs from user (name and age), then it returns the participant’s age to main( ). If the participant is between 7 and 12 years old, the participant is considered as kid. If the participant is between 13 and 17 years old, the participant is considered as teenager. Write the program by implementing while loop and if-else statement.
Expert's answer
#include <stdio.h>
#include <stdlib.h>

int Event();

int main()
int age;
age = Event();
if (age > 6 && age < 13)
printf("Participant is kid.");
if (age > 12 && age < 18)
printf("Participant is teenager.");
return 0;

int Event()
char name[255];
int age;
printf("Enter user name: ");
scanf("%s", name);
printf("Enter user age: ");
scanf("%d", &age);
return age;

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions