#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 ;
}
}
Labels: C++ Codes, C++ Loops Codes
Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies| |
---|
0 comments:
Post a Comment