1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
4 years ago
9

Write a C program to perform simple C arithmetic calculations. The user is to enter a simple expression (integer operator intege

r) such as
15 + 30
The program is to extract the 2 operands and the operator, perform the indicated calculation and display the result. For example
15 + 30 = 45
Operators should include + , - , * , / , and %
Operands are positive integers , no sign
Use getchar to input the expression
Allow for variable spacing before the first operands and between operators and operands ( 0, 1, or more spaces)

Allow the user the option of entering another expression
Code a function for each operator to do the appropriate arithmetic operations (5 functions)
No global variables
No string handling functions
No arrays
May only use input and output functions such as getchar and putchar
Computers and Technology
1 answer:
Ilya [14]4 years ago
8 0

Answer:

Input example:

select the funcion: 1                                                                                                                  

write the 1sd number2                                                                                                                  

write the 2nd number1                                                                                                                  

value is 2.000000                                                                                                                      

Explanation:

#include <stdio.h>

main()

{

//define the variables as float

float a, b, c, e;

char d;

while (1)  

{      

//input values

printf("select the function: ");

scanf("%c",&d);

printf("write the 1sd number");

scanf("%f",&a);

getchar();

printf("write the 2nd number");

scanf("%f",&b);

getchar();

if (d=='%')

{

    a=a*b/100;

}

if (d=='*')

{

    a=a*b;

}

if (d=='+')

{

    a=a+b;

}

if (d=='/')

{

    a=a/b;

}

if (d=='-')

{

    a=a-b;

}

printf("value is %f \n",a);

}

printf("final value is %f",a);

getchar();

}

You might be interested in
Which of these terms is a design principle?
Sonja [21]
The answer is B. Proportion
8 0
3 years ago
What are computers used for?
lara31 [8.8K]
Computers are used for calculating problems, finding resources, listening or watching entertainment, connecting people together, and storing information.
6 0
3 years ago
Read 2 more answers
What wireless networking standard provides the best performance at the farthest edge of its reach
MakcuM [25]

Answer:

802.11n standard

Explanation:

IEEE 802.11 is part of the IEEE 802 set of LAN protocols, and specifies the set of media access control and physical layer protocols for implementing wireless local area network Wi-Fi computer communication in various frequencies, including but not limited to 2.4 GHz, 5 GHz, and 60 GHz frequency bands.

Currently, routers running the 802.11n standard have the longest range. The unimpeded range, at the same data rates, is roughly double that of the previous 802.11g standard.

802.11g offers wireless transmission over distances of 150 feet and speeds up to 54Mbps compared with the 11Mbps of the 802.11b standard.

4 0
3 years ago
_____ is an effort by an employee to attract attention to a negligent, illegal, unethical, abusive, or dangerous act by a compan
AVprozaik [17]

Answer:

The answer is "whistle-blowing".

Explanation:

Whistleblowing is the organization's disclosure Part of the illegal immoral or existing. Unauthorized actions under the administrative influence. In this the workers, people or organizations operate to perform.

  • The main objective of this initiative is to eliminate non-ethical organizational behavior.  
  • It provides integrity or by being truthful throughout all times, doing all the correct thing is a key element of professional morality and conduct.
4 0
3 years ago
Lin is booting up his computer, and during the boot process, the computer powers down. After several unsuccessful attempts to bo
Alex787 [66]

Answer:

A. Processor.

Explanation:

When a computer system works working or does not boot, it is mostly ask a result of power supply failure.

The system does not come on, that is, the fan and screen does not come up and the caps lock indicator is not blinking. The power supply shows that the power is good.

When the processor is not sitting properly and when the motherboard has failed, the signs mentioned above are observed.

Not to escalate the problem, test for the processor status as a probable cause with another functional and compatible processor before the motherboard.

4 0
3 years ago
Other questions:
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • What is institutional advertising focused on promoting?
    8·1 answer
  • Which network component connects a device with the transmission media?
    9·1 answer
  • Question #4
    5·2 answers
  • Given a dataset where the dataset is not linearly-separable, and each of the fea- tures have continuous values, which of the fol
    7·1 answer
  • A support agent who feels that a user needs substantial assistance with the organization of files on their pc should ____.
    5·1 answer
  • How to change your name to a fake one
    8·1 answer
  • Who tryna play fortnite?
    5·2 answers
  • The following SQL is which type of join? SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,OR
    15·1 answer
  • _______ refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!