Write a program to enter a value and to check entered number is two digits-based number or not.

C++ (TurboC)
#include <iostream.h>

void main() 
{ 
    int num; //num is variable of integer data type
    cout<<"Enter the number"; 
    cin>>num;
    if(num>9 && num<100)
{
    cout<<"Entered number is two digits based";
}
    else
{
    cout<<"Entered number is not two digits based";
}
}

Post a Comment

0 Comments