1 like 0 dislike
12.8k views

Write the C program that receives the number of coffee cups and teacups. The program shows the TOTAL price after user press Enter. The price for one cup of coffee is $35, one cup of tea is $25 

寫一個計算咖啡跟茶的總計

Example input:

3 2

Example output:

155
[Exercise] Coding (C) - asked in Chapter 2: C Fundamentals by (9.9k points)
ID: 25482 - Available when: Unlimited - Due to: Unlimited

edited by | 12.8k views

73 Answers

0 like 0 dislike
Hidden content!
*** ** ********
int main(){
** * **** * * ** * * * a,b,total;
** ***** * * *** * *** * * *** * * ** * * ***
* *** ** ** ****** *** ** * **
** ****** * * * ** **** * **** ***** ***
return 0;}
answered by (-32 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* * * * ** *** *** *** *
int main(){
* ** * * ** * * **** * a,b,total;
** * *** * ** * ** ** **** ****** * ** ***** * * ***
** * * * * *** ** * **
* ** * * *** * *** * ** * * * **** **
return 0;}
answered by (-32 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* *** * * *
int main(){
* ** * * * ** * * * ** * a,b,total;
* * * * * ** **** *** ***** **** ** *** * *** ** *** * *
** ** ** * * *** *
* * ** *** *** **** *** * *** * ** * *
return 0;}
answered by (-32 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
*** * * *** * * *
int main(){
int * *** * **** * **
c=35;
t=25;
** ** number of ** ** * * **
** * ****** *** * ** **
**** ****
* *** * * ** number of ** ** *
**** * ** **** * * ** * **
*** *
** * *** *** *
* ** * ** ** ** **** **

return 0;
}
answered by (16 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
* * *** ** * *
int main(){
int * ***** * ******
c=35;
t=25;
* ** **** * number of * * **
* * ** * * * ** ** * *
* ***
* ****** * number of **** * * *
* * * ***** ** ** * *
* **
* ****
* * * ** * **** **** * *** **

return 0;
}
answered by (16 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
** ** **** * ***
* ** ** main(){
int *
** * * **** *** * **** ***
****
b=b*25;
***
*** * ** * * * * * * * *** ** ********* **

return 0;
}
answered by (-254 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
***** *** *** * *
* * **** ****
* *
int * ***
* * ** *** * * ** ***** *
* *
b=b*25;

** ** * * ** *** *

return 0;
}
answered by (-254 points)
0 0
prog.c:2:3: warning: return type defaults to 'int' [-Wimplicit-int]
   main()
   ^~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>

int main(){
* * * * ** ** *
* * * ****** * * * ****** ** cupfee = 35, cuptea = 25;
* ** * *** * ***** num1,num2;
* * * * ***** * * * * * **
** * ********** * * ** * *** *** ** ** ***** *
* * * * ** ** ** * *
* * ** ****** * * *** * ****** ** * *** * * * * ** *
* *** *** ** ****
** * * *** * *
* ** * * *** *** * 0;
}
answered
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
** *** * ** ***
** main(){
int * * *
*** *** ** * ********
***
b=b*25;
**
** * ** **** ** * *** ** * ** **** **

return 0;
}
answered by (-32 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()

{
* ****** ** * ** * * ** i,j,k;

* ****** *** **** * * * * *
* * * **** * * *** * *** ** *** ** * *
** * * ** ** ***** ** *********
* * * ** **** * *** ** * *

}
answered by (-32 points)
edited by
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()//The price for one cup of coffee is $35, one cup of tea is $25
 ^~~~
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()//The price for one cup of coffee is $35, one cup of tea is $25
 ^~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.159.115.9
©2016-2026

Related questions

4 like 1 dislike
61 answers
[Exercise] Coding (C) - asked Sep 28, 2017 in Chapter 2: C Fundamentals by thopd (12.1k points)
ID: 25484 - Available when: Unlimited - Due to: Unlimited
| 11.2k views
2 like 0 dislike
50 answers
[Exercise] Coding (C) - asked Sep 28, 2017 in Chapter 2: C Fundamentals by thopd (12.1k points)
ID: 25483 - Available when: Unlimited - Due to: Unlimited
| 10.5k views
12,783 questions
183,442 answers
172,219 comments
4,824 users