Monday 24 October 2016

Program : WAP to divide a number with 2 using bitwise operator.



/******Program to devide a number with using bitwise operator****/
#include<stdio.h>
#include<conio.h>

void main()
{
 int  integer_number;
 float  div=0;
 clrscr();
 printf("\n********INPUT**********");
 printf("\n");
 printf("\nEnter a Integer Number:");
 scanf("%d",&integer_number);
 /******Devide the given number by 2*****************/
 div=integer_number>>1;


 printf("\n*********OUTPUT*********");
 printf("\n");
 printf("\nThe First Run:");
 printf("The Result =%f", div);
 getch();
 }

Output:

No comments:
Write comments