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 |
void main() { int a=1; while(a++<=1) while(a++<=2); }
Explain how do you list a file’s date and time?
int a=20; int b=30; int c=40; printf("%d%d%d"); what will be the output?
What is wrong with this initialization?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What is a C array and illustrate the how is it different from a list.
12344321 123 321 12 21 1 1 how i print this program??
5 Answers DSR Management, Winit,
What are data types in c language?
int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?
What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these
c program to print a name without using semicolon
What is meant by operator precedence?