0% found this document useful (0 votes)
82 views4 pages

ITC Lab 2.0

This document outlines tasks for a C++ lab assignment, including printing biographical data, shapes, and tables using cout. The tasks involve writing programs to: 1) print biographical data, 2) print triangles and squares of asterisks, 3) calculate math expressions using cout, 4) print multiplication tables, and 5) print tables with student results including totals. The tasks require using cout and arithmetic operators to display various output.
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)
82 views4 pages

ITC Lab 2.0

This document outlines tasks for a C++ lab assignment, including printing biographical data, shapes, and tables using cout. The tasks involve writing programs to: 1) print biographical data, 2) print triangles and squares of asterisks, 3) calculate math expressions using cout, 4) print multiplication tables, and 5) print tables with student results including totals. The tasks require using cout and arithmetic operators to display various output.
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/ 4

Introduction to Programming

Fall 2020

Lab 2
cout

Department of Information Technology


University of Central Punjab
Task 1
You have to write a C++ program that will print your complete bio data on the screen.

Name:
University ID:
Father Name:
Phone Number:
Address:
Semester:
Course:

Task 2

Task 3

*
***
*****
*******
*********
***********
*********
*******
*****
***
*
Task 4

Write a C++ program that make a square on the screen through cout, for the early work your square size
should be 8 * 8

* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
Then shift that square one tab to the right on the screen

* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
Then try to print that square in the center of the screen, how you will manage that, as every line has 80
characte
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
Task 5

Calculate the output of the following


Cout << 3 * 7 - 6 + 2 * 5 / 4 + 6 <<endl;
Cout << 3 + 2 * (10 - 1) + 18 <<endl;

Task 6

a) Print complete table of 2 from 1 to 10 in the same format given below. The sample output is:
2*1=2
2*2=4
2*3=6
………

b) Print table of numbers formatted as follows. (Make use of arithmetic expression where
required)

Number square cube


--------------------------------------------

0 0 0

1 1 1

2 4 8

c) Print the students roll number and marks of subjects and print the total marks of that students;
sample screen is given below:

************
Result Sheet
************

Student’s Roll No. Math Physics Chemistry Total


----------------------------------------------------------------------------------------------------------
2357 99 85 97 281
----------------------------------------------------------------------------------------------------------

You might also like