/* C Program For Checking whether a number is even or odd */
#include< stdio.h>
#include< conio.h>
void main()
{
int a;
clrscr();
printf("Enter A number : ");
scanf("%d",&a);
if(a%2 != 0)
{
printf("\nThe Number %d Is Odd",a);
}
else if(a%2 == 0)
{
printf("\nThe Number %d Is Even",a);
}
getch();
}
/******************* OUTPUT ********************
Enter A number : 66
The Number 66 Is Even
Enter A number : 37
The Number 37 Is Odd */
Subscribe to:
Post Comments (Atom)
22 comments:
Great job
its really helps us a lot
thank you very much
wow.. thanks to this! =]]
what about
if((num & 0x01))
{
cout << "odd";
}
else
{
cout << "even";
}
thanks for this program
thanks
thankx
#include
#include
void main()
{ clrscr() ;
int subject,topic;
printf("enter the number to find odd or even\n");
scanf("%d",&topic);
if (topic%2==0)
{
printf("the number is even%d\n",topic);
}
else
{ printf("the number is odd%d\n",topic);
}
getch();
}
sohail hussain pakistan 2010
#include
int main()
{
int a;
printf("Enter Your number that you want to check?");
scanf("%d",&a);
if(a%2==0)
{
printf("The Number Is %d Even\n",a);
}
else
{
printf("The Number %d Is Odd\n",a);
}
}
Man I need Explanation
Plzz Help me
whats this %2==0
exactly means
Response somebody plz
Man I need Explanation
Plzz Help me
whats this %2==0
exactly means
Response somebody plz
@Anonymous
it means when u divide any integer with 2, the remainder should be 0 if its an even number...
thanks for that! I've been wondering what modulo means...
thankss a lot...!
These codes not get works on numbers having 12 digit numbers.... Please help..
Agorithm please for this program
Great site you have here but I was wanting to know if you knew of any forums that cover the same
topics talked about in this article? I'd really love to be a part of online community where I can get suggestions from other knowledgeable people that share the same interest. If you have any recommendations, please let me know. Bless you!
my blog visit this site
Wow, superb blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your site is great, as well as the content!
Feel free to visit my weblog: inquiry
Ahaa, its nice discussion about this article here at this webpage, I have read all that,
so now me also commenting here.
Visit my web blog pure green coffee bean dr oz
Ηowdy! I could have sworn I've been to this blog before but after browsing through a few of the posts I realized it's new tо mе.
Regardlеsѕ, I'm certainly pleased I came across it and I'll be bookmarkіng it and checkіng back oftеn!
My web blοg ... cheap party pills
punda
omment moderation has been enabled. All comments must be approved by the blog author.
gooood job
but how i can do same program with switch statement
Post a Comment