Write a programme to find even numbers without using any
conditional statement?
Answer Posted / mathiyazhagan
#include<stdio.h>
main()
{
char res[2][5]={"Even","Odd"};
int n;
printf("Enter a number :");
scanf("%d",&n);
printf("the given no is = %s",res[n%2]);
}
| Is This Answer Correct ? | 51 Yes | 7 No |
Post New Answer View All Answers
Why & is used in scanf in c?
What are the uses of a pointer?
Can you tell me how to check whether a linked list is circular?
Is c a great language, or what?
Describe how arrays can be passed to a user defined function
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
How do you initialize pointer variables?
how many errors in c explain deply
What is %d used for?
What is bubble sort technique in c?
Can a pointer point to null?
What is union in c?
What is a shell structure examples?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Is the exit() function same as the return statement? Explain.