by CodeChum Admin
It's time to find out if something is true or false. Let's test your capabilities by creating a program that checks if two integers are equal!
Instructions:
Input
1. First integer
2. Second integer
Output
The first two lines will contain message prompts to input the two integers.
The next line will contain the inputted integers.
The last line will contain a string which is the result, if the condition were true.
#include <stdio.h>
int main()
{
int n1, n2;
printf("First integer: ");
scanf("%d", &n1);
printf("Second integer: ");
scanf("%d", &n2);
printf("%d %d\n", n1, n2);
if (n1 == n2)
printf("Equal\n");
return 0;
}
Comments
Leave a comment