To find whether a number is even or odd without using any
conditional operator??
Answer Posted / mohd adnan
/* By Mohd Adnan MCA(2007-10) IMS Ghaziabad */
/* by using bit wise operator*/
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter any number:");
scanf("%d",%num);
(num&1)&&printf("Odd Number");
((num&1)==0)&&printf("Even Number");
getch();
}
Is This Answer Correct ? | 37 Yes | 15 No |
Post New Answer View All Answers
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
What the different types of arrays in c?
Explain how to reverse singly link list.
What is sizeof c?
What are valid signatures for the Main function?
How can I read/write structures from/to data files?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is c language in simple words?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What are integer variable, floating-point variable and character variable?
How to create struct variables?
What is the difference between text and binary modes?
What does %d do in c?
What is sizeof int?