Explanation: This program accepts the salary and age of an applicant. If the salary is greater than 25000 and the age is greater than 25, then the loan is approved. Otherwise, the loan is rejected.
#include <stdio.h> #include <conio.h> main() { int s,a; clrscr(); printf("Enter Salary : "); scanf("%d",&s); printf("Enter Age : "); scanf("%d",&a); if(s > 25000 && a > 25) { printf("\nLoan of 500000 is Granted"); } else { printf("\nLoan of 500000 is Rejected"); } getch(); }
Output:
&&) operator with the if-else statement.age >= 18 && percentage >= 60.
#include <stdio.h> #include <conio.h> main() { int age,percentage; clrscr(); printf("Enter Age : "); scanf("%d",&age); printf("Enter Percentage : "); scanf("%d",&percentage); if(age >= 18 && percentage >= 60) { printf("\nEligible for Scholarship"); } else { printf("\nNot Eligible for Scholarship"); } getch(); }
&&) operator, it checks whether both conditions are true. If the age is 18 or above and the percentage is 60 or above, the student is eligible for a scholarship; otherwise, the student is not eligible.