sign up I login
 advanced
refer a friend - earn nickels!!

Ask & Discuss Questions with Community & Experts

Moderation Team
Ask iit jee aieee pet cbse icse state board community Discussion Response Post to: C++ simple doubt
Forum Index -> Course Material -> View Full Question like the article? email it to a friend.  
Author Message
aditya_arora04 (1077)

Blazing goIITian

Olaaa!! Perrrfect answer. 163  [294 rates]

aditya_arora04's Avatar

total posts: 1042    
offline Offline
Well,
 
 
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
   int arr[80];
  int num;
  cout<<"Enter a number : ";
  cin>>num;
  int count,i=0;
  count=0;
  do
{  count=num%2;
   arr[i]=count;
   num=num/10;
   i++;
 }while(count!=0);
  cout<<"\nBinary equivalent of number : ";
  for(int j=i;j>=0;j--)
    {  cout<<arr[j];
    }
getch();
}

My birthday is no ordinary day.

Its the day when i declared in my own voice,

I WILL NOT GO QUIETLY INTO THE NIGHT,
I WILL NOT VANISH WITHOUT A FIGHT,
I AM GOING TO LIVE ON,
I AM GOING TO SURVIVE,
I AM GOING TO GET WHATEVER I WANT.

I CELEBRATE MY BIRTHDAY, AS MY INDEPENDENCE DAY !!!!!!!!!
 this reply: 10 points  (with Olaaa!! Perrrfect answer.   in 2 votes )   [?]
 
You have to be logged on to rate
  
 

Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Narayana - Kota , Delhi , Others
Brilliant Tutorials - Class , Crash
Aakash Institute - Medical , Engg
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya