Answer to Question #342831 in C for Karyo

Question #342831

1. Are Integers Created Equally?

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:

  1. Input two integers in one line.
  2. Print the two integers in one line, and separate them with a space.
  3. Print a string message "Equal" on a new line, if both inputted integers are equal.

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.



1
Expert's answer
2022-05-19T08:56:53-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS