Write a pro-gramme to determine whether the number is even or odd?



Write a pro-gramme to determine whether the number is even or odd?..

Answer / azad sable, chiplun

void main();
{
int n;
clrscr();
printf("enter any number");
scanf("%d",&n);
if(n%2==0)
printf("\nthe number is even");
else
printf("\nthe number is odd");
}
getch();
}

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More C Interview Questions

If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5).

5 Answers   Microsoft, Motorola,


Apart from dennis ritchie who the other person who contributed in design of c language.

0 Answers  


Difference between Function to pointer and pointer to function

0 Answers  


What is the scope of static variable in c?

0 Answers  


Why enum is used in c?

0 Answers  






what is a constant pointer in C

0 Answers  


Can you please explain the difference between syntax vs logical error?

0 Answers  


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

0 Answers   Infosys,


How would you obtain the current time and difference between two times?

0 Answers   TISL,


what are non standard function in c

0 Answers  


In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

0 Answers   Infosys,


What are the 3 types of structures?

0 Answers  


Categories