void main() { int age; clrscr(); printf("Enter the age"); scanf("%d", &age); (age>=21 && age<=65)? printf("\n\nThe person is adult"):printf("\n\nThe person is not adult"):printf("\n\nThe person is not a senior citizen"); getch(); }
void main() { int year; clrscr(); printf("Enter any year"); scanf("%d", &year); (year%4==0)? printf("\n\nIt is a leap year"):printf("\n\nIt is not a leap year"); getch(); }
void main() { char no; clrscr(); printf("Enter the number"); scanf("%c", &no); (no>=0 && no<=47 || no>=58 && no<=64 || no>=91 && no<=96 || no>=123 && no<=255)? printf("\n\nIt is a special symbol"):printf("\n\nIt is not a special symbol"); getch(); }
void main() { char no; clrscr(); printf("Enter the number"); scanf("%c", &no); (no>=97 && no<=122)? printf("\n\nIt is a lower case alphabet"):printf("\n\nIt is not a lower case alphabet"); getch(); }
#include<math.h> void main() { int a,b,power; clrscr(); printf("Enter the value of a and b"); scanf("%d%d",&a,&b); power=pow(a,b); printf("%d",power); getch(); }