move exercises, lecture examples, labs into subfolders
This commit is contained in:
19
Exercises/C4/reformatted_code.c
Normal file
19
Exercises/C4/reformatted_code.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
int main(void)
|
||||
{
|
||||
// Declare variables and give initial values
|
||||
int revenue = 80;
|
||||
int cost = 50;
|
||||
int roi;
|
||||
|
||||
// Perform calculation
|
||||
roi = (100 * (revenue - cost)) / cost;
|
||||
|
||||
// Make decision based on value of roi
|
||||
if (roi >= 0)
|
||||
{
|
||||
printf ("%d\n", roi);
|
||||
}
|
||||
|
||||
return 0; // Exit indicating success
|
||||
}
|
||||
Reference in New Issue
Block a user