i want to display the binary value for a character its not printing out can someone help me out please
Code:
#include<stdio.h>
#include<conio.h>
#include<iostream>
#include<time.h>
#define mask 128
void getbinary(char ch);
int main()
{
char c;
int i;
printf("Enter character=>");
scanf("%c",&c);
getbinary(c);
printf("the binary value for %c is ",c);
printf("\n");
for (i=0;i<8;i++);
{
printf("hi %c",c);
if((c & mask)==0)
{
printf("0");
}
else
{
printf("1");
}
c=c<<1;
}
getch();
}
void getbinary(char ch)
{
printf("ASCII value of '%c' is: has ASCII %i",ch, ch);
}