You are on page 1of 5

Lab Report #02

Lab Tasks:
Task No. 01: Take two integers as input from the user apply
arithmetic operations on them (+, -, *, /) as print them on screen.

Task code:

Output:

Page | 1
TASK NO. 02:
Write a C program to calculate the distance between the two points.
d = (x2 – x1) ^2 + (y2 – y1) ^2
Task Code:

Output:

Page | 2
Post Lab task
Q1. Where a cin does stops during extraction of data?

Ans. Cin will stop its extraction when it encounters a blank space.

Q2. Which is used to get the input during runtime?

a) cout

b) cin

c) coi

d) none of the mentioned

Ans. Cin is used to get the input during runtime.

Conclusion

Conclusion 01:

Name: Amna Sohail

ID: 190945

In this lab, we learnt about variables; their different types and


purposes, cout; how to get the desired output on the console
window, cin; taking input from the user and we used different
operations on the variables.

Page | 3
Conclusion 02:

Name: Khansa Naz

ID: 190321

In this lab task we learnt how to create different variables,


different operators, how to take input from the user and getting
its output on console window.

Conclusion 03:

Name: Shamamah Batool

ID:190333

This was our second lab in which we learnt about variables and
how to use them in programming. We learnt about types of
operations and their usage. Also, we learnt the concept of cin
and cout.

Page | 4
Page | 5

You might also like