Sunday, August 16, 2020

Age Checker in C

 A simple program that I wrote that will ask the user to give their age and the program will check and determine whether that user age is still a minor or already an adult using C programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com




Sample Program Output

Program Listing

#include <stdio.h>
 

int main()
{   
    char *age_checker[] = {"You are still a Minor.",
                     "You are already an Adult.",
};
    char *display_age;
 
    int age=0;
    
    printf("\n\n");
printf("\tAge Checker in C");
printf("\n\n");
printf("\tWhat is Your Age? : ");
    scanf("%d",&age);
     
     
     if (age >= 18) {
display_age = age_checker[1];
}
     switch (age < 18) {
     
    case 1 : case 2 : case 3 : case 4: case 5:
    case 6 : case 7 : case 8 : case 9: case 10:
    case 11 : case 12 : case 13 : case 14: case 15:
    case 16 : case 17 : 
display_age = age_checker[0];
break;
                  
}
    
    
printf("\n\n");
printf("\t===== DISPLAY RESULTS =====");
printf("\n\n");
printf("\tAt the age of %d years old.\n\n",age);
printf("\t%s",display_age);
printf("\n\n");
printf("\tEnd of Program");
printf("\n");
}




No comments:

Post a Comment