Computer Science, asked by shleshamogli, 3 months ago


Write a program to declare one integer variable and give it an appropriat
value using scanf(). You are required to print the number and print the result
when the variable is compared with 5 by using == and !=. Write an output.

Answers

Answered by jai696
6

\huge\red{\mid{\fbox{\tt{Using\: C}}\mid}}

#include <stdio.h>

int main()

{

int myInt;

printf("Enter an integer: ");

scanf("%d", &myInt);

printf("myInt: %d\n", myInt);

printf("myInt == 5: %s\n", myInt == 5 ? "true": "false");

printf("myInt != 5: %s\n", myInt != 5 ? "true": "false");

return 0;

}

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
0

Answer:

#include <stdio.h>

int main()

{

int myInt;

printf("Enter an integer: ");

scanf("%d", &myInt);

printf("myInt: %d\n", myInt);

printf("myInt == 5: %s\n", myInt == 5 ? "true": "false");

printf("myInt != 5: %s\n", myInt != 5 ? "true": "false");

return 0;

}

Explanation:

pls follow up

Similar questions