Massive Discounts - Ending Soon Limited Offer

Amazon Countdown Deals Closing Soon

Guaranteed Lifetime Commissions - Easy Sell and Unlimited

>
Results 1 to 2 of 2
  1. #1

    check whether given number is binary or not ?

    Hello Dear,

    Please Tell Me How to check whether given number is binary or not ?

  2. #2
    • #include<stdio.h>
    • int main(void){
    • // your code goes here
    • int num=13445,j=0,k;
    • while(num>0)
    • {
    • j=num%10;
    • if((j!=0)||(j!=1))
    • {
    • printf("num is not binary");
    • break;
    • }
    • num=num/10;
    • if(num==0)
    • {
    • printf("num is binary");
    • }
    • }
    • return0;
    • }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Ad Here