Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Taco practice
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
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
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//MIDTERM QUESTION Z=X+++--Y // x=1,y=2,z=0 //y=y-1 //z=x+y // // // #include <stdio.h> int main(void) { int carCount=10; int numAtoms=7; int boxCount=10; int numItems=10; int costDrink=2; int costTacos=3; int numDrink=4; int numTacos=6; int totalCost; totalCost=numDrink*costDrink; totalCost=totalCost+(numTacos*costTacos); printf("Total cost: %d\n", totalCost); numItems=boxCount+1; printf("numItems is %d\n", numItems); numAtoms+=5; printf("numAtoms is %d\n", numAtoms); numAtoms=7; numAtoms*=2; printf("numAtoms is %d\n", numAtoms); carCount=carCount/2; printf("carCount is %d\n",carCount); return 0; //x++ and ++x is the same effect for incrementing }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.15 sec, absolute running time: 0.24 sec, cpu time: 0.16 sec, memory peak: 3 Mb, absolute service time: 0,4 sec
edit mode
|
history
|
discussion
Total cost: 26 numItems is 11 numAtoms is 12 numAtoms is 14 carCount is 5