write a program for even numbers?

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


Please Help Members By Posting Answers For Below Questions

Which header file is essential for using strcmp function?

1051


What is the use of getchar functions?

793


What is scope rule in c?

705


The file stdio.h, what does it contain?

773


What is nested structure in c?

699






What is abstract data structure in c?

623


How does selection sort work in c?

713


How can I do peek and poke in c?

733


Why double pointer is used in c?

658


What is difference between structure and union with example?

696


Why is it usually a bad idea to use gets()? Suggest a workaround.

1052


What is the purpose of scanf() and printf() functions?

806


What are the differences between Structures and Arrays?

713


Can a pointer point to null?

688


When can you use a pointer with a function?

645