Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

{

Introduction to
Programming
Lab 2
... }
Introduction to Programming First Year 2023 -
2024
Agenda

 Steps to Create a new project C++.

 C++ Syntax.

 Print output on screen.

 C++ Comments.
How To Open Dev?
1 . Start -> All program -> DEV C++ 2 . File -> New -> Project
3. Click Empty Project

Write
Select
Write the
Click
the Project
C++ OK
File Project
Name.
Name. 4
Click
Select theSave.
path.
4. Empty Project

Writing
Projectcode
ToolbarFiledetails
Implementation
5
5. C++ Syntax.

The rules and regulations for writing statements in a programming language.

Header
6
IsAllows
whichan
is youfiles
object used
a function. are
Any
to use used
along to
with
code
names add
for thespecific
used
within
objects the functionality
toinsertion
end the main
andcurly brackets
variables tothe
{}C++
function.
operator (<<)
from to programs.
print
will the output text.
be executed.
standard library.
C++ Output ( print text ) .
** The cout object, together with the << operator , is used
to output values/print text .

** It is used to display the output to the standard output


device i.e. monitor. The data needed to be displayed on the
screen is inserted in the standard output stream (cout) using
the insertion operator(<<) .

Header
7
IsAllows
whichan
is youfiles
object used
a function. are
Any
to use used
along to
with
code
names add
for thespecific
used
within
objects the functionality
toinsertion
end the main
andcurly brackets
variables tothe
{}C++
function.
operator (<<)
from to programs.
print
will the output text.
be executed.
standard library.
6. Print output on screen.

7. Results

8
*
C++ Comments
{. .
● In C++, the compiler ignores the text followed by the
comments. C++ supports two different types of comments:

● //: specifies the single-line comment.


● /* ….*/: specifies the multi-line comment.

}
*
Exercises
{. . Write a program in c++ to print welcome

}
Thank You

You might also like