Exercise CSC425
Exercise CSC425
3. The source code below cannot be compiled and run because of some errors.
Find out what is the error(s) and fix it. Then, run this program correctly.
#include <iostream>
using namespace std;
main()
{
int num;
cout<<"Enter a number :";
cin>>num;
if(num%2==0)
{
cout<<"This is an even number";
}
else
{
cout<<"This is an odd number";
}
return 0;
}
5. Using your programming knowledge, create a simple program that converts from
meters to centimeters (please draw a flowchart too).
Begin
Read measurement in M
CM = M * 100
Display measurement in CM
End
6. Write, run and test this program:
Unfortunately, program above return some errors. Hence, find the errors and fix
it.