Program to find the new numbers
#include<iostream>
using namespace std;
int main()
{
int a,mid,sp=0,ep=5;
cout << "enter the value of a:";
cin >> a;
mid = (sp + ep) / 2;
if (a >= 0 && a <= 2)
{
if (a >= 0 && a<=1)
{
if (a == 0)
{
cout << "No is 0";
}
else
{
cout << "No is 1";
}
}
else
{
cout << "NO is 2";
}
}
else if (a >= 3 && a <= 5)
{
if (a >= 3 && a <= 4)
{
if (a == 3)
{
cout << "No is 3";
}
else
{
cout << "no is 4";
}
}
else
{
cout << "No is 5";
}
}
getchar();
getchar();
return 0;
}
Comments
Post a Comment