Answer Posted / joe
#include<stdio.h>
//#include<conio.h>
int main()
{
//clrscr();
int *a;
printf("\nenter the no\n");
scanf("%d",&a);
if(*a <0)
{
printf("\nEnter correct number :\n");
}
else if(*a%2==0)
{
printf("no is even");
}
else
{
printf("odd no");
}
getch();
main();
}
| Is This Answer Correct ? | 15 Yes | 15 No |
Post New Answer View All Answers
Differentiate between the expression “++a” and “a++”?
What is a loop?
Explain built-in function?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
How can I access an I o board directly?
How a string is stored in c?
What is the use of the function in c?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What Is The Difference Between Null And Void Pointer?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
When should structures be passed by values or by references?
Why doesnt that code work?
What is memcpy() function?
What is void pointers in c?
Can we use visual studio for c?