Write a c program to check whether the given number is binary or not
Answers
Answered by
1
hi here is ur answer...
#include<stdio.h>
void main()
{
int n;
clrscr();
printf("enter a no.");
scanf("%d",&n);
if(n%10==0n%10==1)
printf("yes binary");
else
printf("not binary");
getch();
}
}
...........
#include<stdio.h>
void main()
{
int n;
clrscr();
printf("enter a no.");
scanf("%d",&n);
if(n%10==0n%10==1)
printf("yes binary");
else
printf("not binary");
getch();
}
}
...........
Similar questions