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
What are linked lists in c?
i have a written test for microland please give me test pattern
How can a program be made to print the line number where an error occurs?
What is the difference between malloc() and calloc()?
How can I convert a number to a string?
Can a variable be both static and volatile in c?
What do you mean by a local block?
How arrays can be passed to a user defined function
write a c program for swapping two strings using pointer
Why is #define used?
What is 1f in c?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
How #define works?
What does %p mean c?
What is derived datatype in c?