0% found this document useful (0 votes)
5 views6 pages

Lab No1

This document outlines Lab No. 1 for an introduction to C++ programming, focusing on basic programming tasks using the Dev C++ IDE. It includes sample tasks such as printing a name, calculating the sum and product of numbers, and displaying biodata. Additionally, it provides exercises for variable declaration and performing operations with multiple variables.

Uploaded by

sherazqasim874
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)
5 views6 pages

Lab No1

This document outlines Lab No. 1 for an introduction to C++ programming, focusing on basic programming tasks using the Dev C++ IDE. It includes sample tasks such as printing a name, calculating the sum and product of numbers, and displaying biodata. Additionally, it provides exercises for variable declaration and performing operations with multiple variables.

Uploaded by

sherazqasim874
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/ 6

Lab No.

1
Introduction to C++ programming

Objective :
In this lab software introduction has been discussed along with basic writing of the
program inside the compiler and its steps.
Tools:
Dev C++
Background Knowledge:
Dev C++ is an Integrated Development Environment (IDE) for C and C++
programming language. With this environment you can edit, build, run, and debug
your program freely. You can write Windows or console-based C/C++ programs
easily.
C++ is a statically typed, free-form, (usually) compiled, multi-paradigm,
intermediate-level general-purpose middle-level programming language. Many of
today’s operating systems, system drivers, browsers and games use C++ as their core
language. This makes C++ and its software like C Fee and DEV C++ an excellent
choice. Since it is an enhanced/extended version of C programming language, C and
C++ are often denoted together as C/C++.
Sample Tasks
Task 1
Write a program to print your name on the output screen
#include <iostream>
using namespace std;
int main( )
{
cout<<"rayan ullah "<<endl;
}

1
Task 2
Write a program to calculate the sum of any two numbers on the output screen
#include
<iostream>
using namespace std;
int main( )
{
int a,b,sum;
a=2;
b=3;
sum=a+b;
cout<<"Sum ="<<sum<<endl;
}

Task 3
Write a program to multiply any two numbers and print the result on the output
screen
#include
<iostream>
using namespace std;
int main( )
{
int a,b,mul;
a=2;
mul=a*b;
cout<<"Multiply
="<<mul<<endl; return 0;

2
}
Exercise :
Exercise 1:
Write down the syntax for declaration of variable
Solution:
#include<iostream>

Using namespace std;

Int main;(){

String name;

Name="rayan ullah";

Cout<<|"my name is"<<name;

Return 0;

Marks Obtained Total Marks

Instructor Signatures:

Remarks:

Exercise 2
Write a proggram which displays your Bio data on the output screen.
Solution:

3
#include<iostream>

Using namespace std;

Int main;(){

Cout<<"name:rayan ullah"<<endl;

Cout<<"sap id :70174891">>endl;

Cout<<"program:bsiet"<<endl;

Cout<<"sec:j"<<endl;

Return 0;

4
Marks Obtained Total Marks

Instructor Signatures:

Remarks:

Exercise 3
Write a program to add and multiply any three variables a, b, c and print
the result on the output screen
Solution:
#include<iostream>
using namespace std;
int main(){
int a,b,c,multiply;
a=6;
b=6;
c=6;
multiply=a*b*c;
cout<<"multiply="<<multiply<<endl;
return 0;

Marks Obtained Total Marks

Instructor Signatures:

Remarks:

5
FINAL EVALUTION LAB 01
Student Name:

Registration Number:

Date:

Marks Obtained Total Marks

Instructor Signatures:

Remarks:

You might also like