write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / manojkumar
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the number :");
scanf("%d",&a);
b=a%2;
switch(b)
{
case 1:
printf("The number %d is even",no);
break;
case 2:
printf("The number %d is odd",no);
break;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is the difference between int main and void main?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What does. int *x[](); means ?
What are the 3 types of structures?
What is main () in c language?
What is property type c?
What are the disadvantages of a shell structure?
Define circular linked list.
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Explain low-order bytes.
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What is boolean in c?
find the sum of two matrices and WAP for it.