In: Computer Science
The program is made for deciding either a candidate
who is applying for Pakistan armed
forces is eligible or not. An eligible candidate must fulfil all
necessary conditions as give in
the following criteria:
Criterion Value
Nationality Pakistani or AJK
Age Between 18-22, boundaries are inclusive
Education minimum 14 years
Table 1: Criteria for Pakistani armed forces eligibility
Develop program using C language
Program in C language:
#include <stdio.h>
int main()
{
char nt;
int age,edu;
printf("Is your nationality Pakistani or AJK?(Y/N): ");
scanf("%c",&nt);
printf("\nEnter your age: ");
scanf("%d",&age);
printf("\nEnter your total years of education: ");
scanf("%d",&edu);
if((nt=='y' || nt=='Y') && (age>=18 && age<=22) && edu>=14)
printf("\nYou are eligible to apply for Pakistan armed forces");
else
printf("\nYou are not eligible to apply for Pakistan armed forces");
return 0;
}
Code screenshot with outputs: