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 |
sum of two integers values only other then integer it should print invalid input.
errors in computer programmes are called
Tell me can the size of an array be declared at runtime?
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?
Explain how do you convert strings to numbers in c?
Create a simple code fragment that will swap the values of two variables num1 and num2.
How do you redirect a standard stream?
void main() { int a=1; while(a++<=1) while(a++<=2); }
What are file streams?
Is double link list a linear data structure? If Yes, Why?If No, Why?
main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
What is the mean of function?