Answer Posted / bertilla
#include<conio.h>
#include<stdio.h>
void main()
{
int i,n,arr[15];
for(i=0;i<=14;i++){arr[i]=0;}
do
{
arr[i]=n%2;
n=n/2;
i--;
if(n==1){arr[i]=1;}
}while(n>1);
for(i=0;i<=15;i++)
{
printf("%d",arr[i]);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
How do I use void main?
difference between native and cross compilers
How can I prevent another program from modifying part of a file that I am modifying?
What is the difference between text and binary modes?
What are qualifiers and modifiers c?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Can you please explain the scope of static variables?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
How to write c functions that modify head pointer of a linked list?
What is && in c programming?
Is that possible to store 32768 in an int data type variable?
What is meant by 'bit masking'?
Multiply an Integer Number by 2 Without Using Multiplication Operator