To find whether a number is even or odd without using any
conditional operator??
Answer Posted / mukul garg
main()
{
int num;
clrscr();
printf("enter the number");
scanf("%d",&num);
(num%2==0)?printf("even num"):printf("odd num");
}
| Is This Answer Correct ? | 13 Yes | 16 No |
Post New Answer View All Answers
What is the use of c language in real life?
What does the file stdio.h contain?
What does the c preprocessor do?
p*=(++q)++*--p when p=q=1 while(q<=6)
How can I handle floating-point exceptions gracefully?
All technical questions
What is malloc() function?
What are the valid places to have keyword “break”?
Why do some versions of toupper act strangely if given an upper-case letter?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Why is c known as a mother language?
What is bin sh c?
What is string concatenation 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.
What is character set?