C
chunkygnome
Guest
I am just starting C++ and tried to write a program that tells if a number is bigger than another/ equal. It works fine when a number is bigger or smaller, but the "equal" part doesn't work.
#include <stdio.h>
main()
{
int a , b;
do {
printf("First # is ");
scanf("%d",&a);
printf("Second number is ");
scanf("%d",&b);
if (a<b) printf("First number is less than second");
if (b<a) printf("Second number is less than first");
if (b==a) printf("They are equal");
} while (a < 999);
}
Help would be appreciated, as i am getting balder and balder with more hair being torn out.
#include <stdio.h>
main()
{
int a , b;
do {
printf("First # is ");
scanf("%d",&a);
printf("Second number is ");
scanf("%d",&b);
if (a<b) printf("First number is less than second");
if (b<a) printf("Second number is less than first");
if (b==a) printf("They are equal");
} while (a < 999);
}
Help would be appreciated, as i am getting balder and balder with more hair being torn out.




