Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
Assignment 3 Final
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//gcc 5.4.0 #include <stdio.h> int main(void) { float yogurtPrice=4; int yogurtQ=1; float applePrice=5; int appleQ=1; float beerPrice=10; int beerQ=1; float sodaPrice=7; int sodaQ=1; char name[40]; int cardNumber; int expirationMonth; int expirationYear; float totalPrice; int quantity; scanf("%d %d %d %d", &yogurtQ, &appleQ, &beerQ, &sodaQ); scanf("%d", &cardNumber); scanf("%d %d", &expirationMonth, &expirationYear); printf("The expiration date is %d/%d\n",expirationMonth, expirationYear); yogurtQ--; totalPrice=(yogurtPrice*yogurtQ)+(applePrice*appleQ)+(beerPrice*beerQ)+(sodaPrice*sodaQ); totalPrice=totalPrice*1.05; quantity=yogurtQ+appleQ+beerQ+sodaQ; printf("The total price %.02f\n", totalPrice); scanf("%s", name); printf("Thank you %s\n", name); return 0; }
gcc
2 3 5 2 56486468468468 12 20 Nathan
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.13 sec, absolute running time: 0.16 sec, cpu time: 0.07 sec, memory peak: 3 Mb, absolute service time: 0,38 sec
edit mode
|
history
|
discussion
The expiration date is 12/20 The total price 87.15 Thank you Nathan