6 喜歡 0 不喜歡
210 瀏覽

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

[正常] 開放式問答 - 最新提問 分類:Questions Bank | 用戶: (5.9k 分)
ID: 28125 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 210 瀏覽
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:108.162.216.17
©2016-2024

相關問題

5 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 2月 19, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21974 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 232 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶