Friday, September 27, 2013

C++ Program using nested if else

Program

#include<iostream>
using namespace std;
int main(){
int a;
cout<<"Enter the value of a ";
cin>>a;
if(a>0)
    cout<<"A is greater than 0";
else if(a<0)
    cout<<"A is less than 0";
else if(a==0)
    cout<<"A is 0";
else
    cout<<"Wrong Choice";
return 0;
}

Output:-

1 comment:

Ads Inside Post