Download presentation
Presentation is loading. Please wait.
2
Introduction To Programming
:Author: Muhammad Meer Hazaar Khan Introduction To Programming
3
Salam & Hello! I am Muhammad Meer Hazaar Khan
Alhamdolilah A licensed professional engineer a schooled and skilled in the application of engineering discipline to the creation of software and seeking to share my knowledge and experience with students . You can find me at CS Department Government College University Layyah Campus or
4
Some Words, Muhammad Meer Hazaar Khan
“Freelancing & Enterprenuership“. LinkedIn Profile: ammad-meer-hazaar-khan- 6b11ab96/ Upwork Profile: cers/~01c0fdce3eda554427 YouTube Channel: nel/UC0Ifqps33SDm5LdYTbEkO1A ?view_as=subscriber “Engineering Degree". B.S.C Software Engineering University And Engineering And Technology Taxila Approved By PEC & Washington Accord U.S.A M.S Degree M.S Computer Science Institute Of Southern Punjab Research Area: Semantic Web Gold Medalist Muhammad Meer Hazaar Khan @ Registered Software Engineer Pakistan Engineering Council No Comp 11516 Lecturer Computer Science Government College University Faisalabad Layyah Campus Freelancer at Upwork Enterprenuer More info on how to find and understand the lectures and the blogs post at Official Website: .
5
Seeking knowledge is an obligation upon every Muslim”
(Sunan Ibn Majjah, 224)
6
Let’s start with the first set of slides
1 Basics OF Programming Let’s start with the first set of slides
7
Text Book Object Oriented Programming in c++ any updated Edition by Robert Lafore
8
Loops Programming languages provide various control structures that allow for more complicated execution paths. A loop statement allows us to execute a statement or group of statements multiple times and following is the general from of a loop statement in most of the programming languages
9
For Loop A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. Syntax: for ( init; condition; increment ) { statement(s); }
10
For Loop #include <iostream> using namespace std; int main () {
// for loop execution for( int a = 10; a < 20; a = a + 1 ) { cout << "value of a: " << a << endl; } return 0;
11
While Loop A while loop statement repeatedly executes a target statement as long as a given condition is true. Syntax: while(condition) { statement(s); }
12
#include <iostream> using namespace std; int main () { // Local variable declaration: int a = 10; // while loop execution while( a < 20 ) { cout << "value of a: " << a << endl; a++; } return 0; Example,
13
Do While Loop Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop checks its condition at the bottom of the loop. A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time. Syntax do { statement(s); } while( condition );
14
#include <iostream> using namespace std; int main () { // Local variable declaration: int a = 10; // do loop execution do { cout << "value of a: " << a << endl; a = a + 1; } while( a < 20 ); return 0; } Example,
15
Nested Loop A loop can be nested inside of another loop. C++ allows at least 256 levels of nesting.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.