Skip to main content
Search
Search This Blog
Adsense
CFETCH
Share
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
Labels
C Programs
July 06, 2013
A C Program to learn the use of shift left and shift right operator.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a,x,y;
clrscr;
printf("Enter value of n:");
scanf("%d",&n);
a=n;
x=n<<1 /*Multiply n by 2*/
y=a>>1 /*Divide n by 2*/
printf("Value of x:%d",x);
printf("Value of y:%d",y);
getch();
}
Comments
Popular Posts
January 17, 2014
C program to draw ellipse using Midpoint Ellipse Algorithm.
July 12, 2013
A C Program to ask the price of an item in decimal and separate rupees and paise.
Comments
Post a Comment