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 |
code snippet for creating a pyramids triangle ex 1 2 2 3 3 3
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
can we define a function in structure?
List a few unconditional control statement in c.
size maximum allocated by calloc()
main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }
1 Answers Vector, Vector India,
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,
What is a union?
Write a programm such that if user enter 11.25 it roundup to 11 but if user enter 11.51 upto 11.99 it will round up to 12 i.e.;convert the floting point value into integer format as explain above..
Can I pass constant values to functions which accept structure arguments?