6 like 0 dislike

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)
Available when: Unlimited - Due to: Unlimited
| 21 views
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.75
©2016-2019

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)
Available when: Unlimited - Due to: Unlimited
| 15 views
3 like 0 dislike
0 answers
[Normal] Fill in the blank - asked Jan 18, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 30 views
5 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Oct 20, 2017 in Questions Bank by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 18 views
9,252 questions
85,585 answers
63,644 comments
2,714 users