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 the difference between far and near in c?
What are the types of type specifiers?
Write the Program to reverse a string using pointers.
What is a volatile keyword in c?
What is the main difference between calloc () and malloc ()?
Tell me about low level programming languages.
When a c file is executed there are many files that are automatically opened what are they files?
What is omp_num_threads?
What is dynamic dispatch in c++?
What is main return c?
Why isnt there a numbered, multi-level break statement to break out
Why doesn't C support function overloading?
Explain enumerated types in c language?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What do header files do?