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 |
Why should I use standard library functions instead of writing my own?
what is the code to display color fonts in the output?
What library is sizeof in c?
What is a macro, and explain how do you use it?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is nested structure?
What does the message "warning: macro replacement within a string literal" mean?
every function has return the value?
for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float
whitch value return void main?
#include<stdio.h> int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20
What are preprocessor directives?