(Move to ...)
▼
Program: The If-else statement as a block
#include <iostream.h>
void main()
{
int x , y ;
cout<<"Enter a number : ";
cin>>x ;
if (x <= 6)
{
int y ;
y = x << 2 ;
cout<<"After two left shifts : "<<y;
}
else
{
int y ;
y = x >> 1 ;
cout<<"After a single right shift : "<<y ;
}
}
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment