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 are void pointers in c?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What are global variables and explain how do you declare them?
how do you programme Carrier Sense Multiple Access
What is this infamous null pointer, anyway?
can we implement multi-threads in c.
What is NULL pointer?
What are inbuilt functions in c?
What is the difference between array and linked list in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
Difference between exit() and _exit() function?
Is c++ based on c?
Which are low level languages?
Can we access array using pointer in c language?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .