Question #98359

Write a program that an integer value from the user. If the value between 1 and 100 inclusive,print "OK" otherwise don't print anything

Expert's answer



#include <iostream>

 

using namespace std;

 

int main()

{

   int value;

 

   // read an integer value from the user

   cin >> value;

   if (value >= 1 && value <= 100)

       cout << "OK";

 

   return 0;

}



LATEST TUTORIALS
APPROVED BY CLIENTS