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)
ID: 28125 - Available when: Unlimited - Due to: Unlimited
| 82 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:3.236.84.188
©2016-2021

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
| 71 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)
ID: 21788 - Available when: Unlimited - Due to: Unlimited
| 85 views
5 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Oct 20, 2017 in Questions Bank by nat236919 (5.9k points)
ID: 28124 - Available when: Unlimited - Due to: Unlimited
| 64 views
11,982 questions
154,986 answers
156,371 comments
4,246 users