Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120490191
exercise02-1.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 4, 18:17
Size
726 B
Mime Type
text/x-c
Expires
Sun, Jul 6, 18:17 (2 d)
Engine
blob
Format
Raw Data
Handle
27192236
Attached To
R1106 Programming Concept Rouaze
exercise02-1.cpp
View Options
/*
* 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
Log In to Comment