Answer Posted / a.balraj
void main()
{
int i,n,p=0,temp,z;
int a[3];
clrscr();
printf("Enter the value of n:\n");
scanf("%d",&n);
i=n;
while(i!=1)
{
if(n%2==0)
{
temp=n%2;
}
else
{
temp=n%2;
}
a[p]=temp;
n=n/2;
i=n+2;
i--;
p++;
}
for(z=sizeof(a)/sizeof(int);z>=0;z--)
{
printf("%d",a[z]);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
What is an identifier?
What is the use of linkage in c language?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
What is 2c dna?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
How can you find the exact size of a data type in c?
What does c in a circle mean?
Array is an lvalue or not?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is register variable in c language?
How many types of errors are there in c language? Explain
Differentiate call by value and call by reference?
Does c have function or method?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
What is string function c?