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

CFP Lab Report 1

The document contains a lab report with 3 programming questions and answers. The first question asks to write a program that prints 'hello world', the second asks to write an introductory program, and the third asks to write a program that prints a diamond shape pattern using asterisks.

Uploaded by

Ahmed Raza
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)
26 views4 pages

CFP Lab Report 1

The document contains a lab report with 3 programming questions and answers. The first question asks to write a program that prints 'hello world', the second asks to write an introductory program, and the third asks to write a program that prints a diamond shape pattern using asterisks.

Uploaded by

Ahmed Raza
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

COMP

UTER
LAB REPORT: 1
FUND
NAME: AHMED RAZA
AMEN
DEPARTMENT: BS-EE-21-25 TALS
LAB TASKS: AND
QUESTION NUMBER: 1

PROGR
Type a program which prints “hello world” on the screen.

PROGRAMME:

#include AMMIN
Using namespace std;

Int main()
G
{

cout<<”hello world”<<endl;

Return 0;

Reference:
Description:
The code prints hello world on the screen by cout which is used to display outputs. Along with
the cout statement it tells us about the basic syntax of cpp.

Question: 2
Write a program that introduces you
Program:
#include<iostream>

Using namespace std;

Int main()

int Number1;

int Number2;

cout<<”My name is Ahmed raza.”<<endl;

cout<<”I am 17 years old”<<endl;

cout<<”I am from kharian”<<endl;

Number1=1041;

Number2=1023;

Cout<<”I scored =”<<”Number1”<<in matriculation”<<endl;

Cout<<”I scored=”<<”Number2”<<in fsc”<<endl;


Cout<<”I am currently studying at PIEAS electrical engineering
department.”<<endl;

Return 0;

Reference:

Description:
This is an introductory code which is used to display some introductory statements on the screen
by cout statement. In addition to that it is used to learn some commands such as endl and
terminators.

Question: 3

Write a program that prints

****
**********
*****************
***********
*******
****
*

Program:

#include<iostream>
using namespace std;

Int main();
{

cout <<” *”<<endl;

cout<<” *****”<<endl;

cout<<” **********”<<endl;

cout<<”****************”<<endl;

cout<<” ************ “<<endl;

cout<<” ******** “<<endl;

cout<<” ****”<<endl;

cout<<” ***”<<endl;

cout<<” *”<<endl;

Reference:

Description:
The program tells us the use of cout . Which is used to display outputs on the screen. The code
displays a stearic diamond on the screen.

You might also like