Write a program to find given number is even or odd without
using any control statement.
Answers were Sorted based on User's Feedback
Answer / rani
#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / saneemask
main()
{
{
char a[][5]= {"Even","Odd"};
int n;
printf("Enter any no.: ");
scanf("%d",&n);
printf("%s",a[n%2]);
getch();
}
{
| Is This Answer Correct ? | 3 Yes | 0 No |
#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }
why r u join this company? give solid resons.
16 Answers IBM, Infosys, TCS,
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is string function in c?
what is a pointer
4 Answers Bank Of America, TCS,
Find string palindrome 10marks
5 Answers Honeywell, Infosys, Riktam, Roland,
Explain goto?
what are the stoge class in C and tel the scope and life time of it?
what are non standard function in c
What do you mean by command line argument?
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }