how to convert binary to decimal and decimal to binary in C
lanaguage
Answer Posted / rahul
[decimal to binary]
#include<stdio.h>
#include<conio.h>
void main()
{
int dec,bin,a[100],i=0,r,j;
printf("enter the decimal number: ");
scanf("%d",&dec);
while(dec>0)
{
r=dec%2;
dec=dec/2;
a[i]=r;
i++;
}
printf("the equivalant binary numberis: ");
for(j=i-1;j>=0;j--)
printf("%d",a[j]);
getch()
}
| Is This Answer Correct ? | 72 Yes | 32 No |
Post New Answer View All Answers
What is c programming structure?
Describe how arrays can be passed to a user defined function
In which layer of the network datastructure format change is done
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Is c is a high level language?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What is far pointer in c?
Explain the use of 'auto' keyword in c programming?
What is difference between constant pointer and constant variable?
Why does notstrcat(string, "!");Work?
How do you construct an increment statement or decrement statement in C?
What is structure packing in c?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
int far *near * p; means
How can you access memory located at a certain address?