You are on page 1of 1

CLA: Programming

Essentials in C C++ INSTITUTE - PROGRAM YOUR FUTURE

Lab 1.3.1.4 Just numbers: part 4


Objectives
Familiarize the student with:

Fixing errors in a program


Integer numbers
Base 8 numbers
Printing on screen

Scenario
Check the program below. Find all possible compilation errors and logic errors. Fix them. Your version of the program must print the
same result as the expected output. Before you use your compiler, try to find the errors only by manual code analysis.

Use octal (base 8) numbers.

#include <stdio.h>

int main()
{
printf("The value of nine is: %d \n", 01x);
printf("The value of ten is: %d \n", 0x2);
return 0;
}

Example output
The value of nine is: 9
the value of ten is: 10

© 2016 C++ Institute. All rights reserved. Last updated: September 27, 2016 | www.cppinstitute.org Page 1 of 1

You might also like