6 like 0 dislike
227 views

Please write a simple program that performs calculation and, shows its result equals to '10'

** There is no restriction as long as the result indicates 10 from its calculation **

** However, your codes should NOT be the same as the given example **

 

Example

#include <stdio.h>
int main(){

int a, b, c, d;

scanf ("%d %d %d", &a, &b, &c);

d = a + b * c;

printf ("%d", d);

return 0;
}

Input

2 2 4

Output

2 2 4
10

Suggestion

  • Try to apply AdditionSubtraction, MultiplicationDivision in your codes
  • Be advised that 'Order of Operation' is crucial. The relative precedence levels of operators found in many C-style languages are as follows

[Normal] Essay (Open question) - asked in Questions Bank by (5.9k points)
ID: 28125 - Available when: Unlimited - Due to: Unlimited
| 227 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.131.152
©2016-2024

Related questions

5 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 19, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21974 - Available when: Unlimited - Due to: Unlimited
| 252 views
12,783 questions
183,443 answers
172,219 comments
4,824 users