0% found this document useful (0 votes)
10 views3 pages

C Cod

Uploaded by

helgamark76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

C Cod

Uploaded by

helgamark76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

UGANDA MARTYRS UNIVERSITY, NKOZI

FACULTY OF SCIENCE

COURSE UNIT: PRINCIPALS OF PROGRAMMING

COURSE: BSC IT

LECTURER: MR. KASAAZI GEORGE WILLIAM

NAME: ECHOKU ROBERT

REG NO.2024-B071-14036

FLOW CHART

START

Declare int yearOfBirth,


currentYear, age

Input name, reg no

Input year of birth,


current

Compute age

Display name,
regno, ag

STOP
#include<iostream>

using namespace std;

int main()

int yearOfBirth, currentYear, age;

//student name and registration number

cout << "\nNAME:ECHOKU ROBERT";

cout << "\nREG NO.2024-B071-14036 ";

// Input year of birth

cout << "\nEnter your year of birth: ";

cin >> yearOfBirth;

//input current year

cout << "\nEnter the current year: ";

cin >> currentYear;

// Computing age

age = currentYear - yearOfBirth;

// input your age and registration number

// Display age and registration number

cout << "Your age: " << age << std::endl;


return 0;

OUTPUT

THE CHALLENGE I FACED

My Devc++ compiler had issues with the compilation process that made my output not to be displayed
in my laptop until I changed the storage partition for compilation of my code thus it was able to run and
give out the output.

You might also like