Q20. Write a C++ program to accept a number and if it is less than 10 then print its square value.
#include<iostream.h> //standard input/output header file
#include<conio.h> //for clrscr()
clrscr(); //for clearing the screen
cout<<“\n Enter a number: “;
a<10? cout<<“\n The square of number is “<<a*a<<“.” : cout<<“\n The number is “<<a<<“.”;
getch(); //holds the screen until any key is pressed
return 0; //makes main() finish
Enter a number: 9
The square of number is 81.
Enter a number: 11
The number is 11.