How do I tell the program that the last number entered was the same.
#include
int
main()
{
int a, b, c, d, e, total;
printf ("Enter a number : "); /*recieve first number*/
scanf ("%d",&a);
if (a%2==0)
{
printf ("The entered number is EVEN.\n");
}
else
{
printf ("The entered number is ODD.\n");
}
printf ("Enter a number : "); /*second number*/
scanf ("%d",&b);
if (b%2==0)
{
printf ("The entered number is EVEN.\n");
}
else
{
printf ("The entered number is ODD.\n");
}
if ("%d=%d", b, a);
{
printf("That is the same number.\n");
}
This is only part of the program. If i enter 3 first than 4 it says I just entered the same number. I think by using 'if' I need to use 'else'.
I want it to tell the user that they entered the same number as the number previous when they actually do.
2007-02-09
08:10:43
·
3 answers
·
asked by
schrickhellcat
1
in
Computers & Internet
➔ Programming & Design