Q21. Write a program to accept a number and if it is less than 50 and greater than 20 than print its square value.
#include<stdio.h> //standard input/output header file
#include<conio.h> //for clrscr()
clrscr(); //for clearing the screen
printf(“\n Enter a number: “);
a<50&&a>20?printf(“\n The square of number is %d.”,a*a) : printf(“\n The number is %d.”,a);
getch(); //holds the screen until any key is pressed
return 0; //makes main() finish
Enter a number: 45
The square of number is 2025.
Enter a number: 78
The number is 78.