Answer Posted / naresh m
main()
{
int a[12],n,m,i=0;
printf("enter the no to find binary no's");
scanf("%d",&n);
while(n!=0)
{
m=i++;
a[i]=n%2;
n=n/2;
}
printf("binary value is");
for(i=m;i>=0;i--)
{
printf("%d",a[i]);
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is return in c programming?
how to make a scientific calculater ?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Write a program to swap two numbers without using third variable?
What are valid operations on pointers?
What are structure members?
What are the 4 types of organizational structures?
program to convert a integer to string in c language'
Can stdout be forced to print somewhere other than the screen?
What are the restrictions of a modulus operator?
What is structure in c definition?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is a memory leak? How to avoid it?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Can we change the value of static variable in c?