Page MenuHomec4science

exercise02-1.cpp
No OneTemporary

File Metadata

Created
Fri, Jul 4, 18:17

exercise02-1.cpp

/*
* exercise02-1.cpp
*
* <--- Description of the program goes here.
*
* Created on: September 02, 2015 <--- Fill in the date here
* Author: Davide Forti <davide.forti@epfl.ch> <--- Fill in your name (and e-mail) here
*/
/*
* Any headers you need to include should be specified on the next lines
*/
#include <iostream>
int main(int argc, char* argv[])
{
double x, y, z;
// Set the value of x and y here :
x = 0.0;
y = 20.0;
if ((x >= y) || (x < 5.0))
{
z = 4.0;
}
else
{
z = 2.0;
}
std::cout << "The value of z is " << z << ". \n";
/* Explanation :
* If x is greater than y or x is lower than 5, the value of z is set as 4.0.
* Otherwise, the value of z is set as 2.0.
*/
return 0;
}

Event Timeline