A. given the flowchart in figure 1 below, write a program that prompts the user to enter two integer numbers, compares them and adds them only if the first number is less than the second number, otherwise subtract them and displays the output in each case. figure 1: flowchart
Answers
Answered by
0
Answer:
Solution in C language
Explanation:
#include <stdio.h>
#include <conio.h>
void main( )
{
int a, b;
clrscr( );
printf("Enter two numbers :");
scanf("%d %d", &a, &b);
if(b>a)
{
printf("Sum is : %d",a+b);
}
else
{
printf("Subtraction is : %d",a-b);
}
getch( );
}
Similar questions