Вы находитесь на странице: 1из 17

Introduction to Programming

Presented By:
Ghulam Mujtaba Shaikh
Course Objectives
Theaim is not to make you the expert of
computer programming but only the
basics of computer programming.

To familiarize students with the use of C-


Language.

To familiarize students with the use of C+


+.
Why this Course?
Recommended Books
Programming in C++ by Dietel and Dietal

Programming in C++ by Robert Laphore

Programming in C by Robert Laphore

Lecture Handouts
IDEs used for this course
Youcan use any of the IDEs given below;
but we will use Dev C++ in the classes
and Labs

DEV C++
Visual C++
Turbo C++
Grading Criteria

Mid Term = 30%


Final Exam = 40%
Quizzes = 5%
CP & CB = 5%
Assignments = 10%
Project = 10%
Lecture No. 1-3
Introduction to C& C++
Recommended Readings

Chapter No. 1 (Introduction to C++)


Book:
Turbo C by Robert Laphore

Lecture Handouts distributed in the class


Topics to be Covered
History and Development of C & C++
Features of C & C++
First program of C++
Explanation of the program
Using IDE for writing the programs
Escape Sequences (\n and \t)
Comments
Single Line Comments
Multiple Line Comments
Recap of the lecture
History of C-Language
C language is a programming language, which was
developed by Dennis Riche at Bells Lab in 1971.
In C language, we can make new softwares or
programs.
Program is a set of instruction, which performs any
particular task.
Before C language, there were so many languages
which were being used by the programmers like GW
Basic, Pascal, and Fortran etc. But after the birth of
C, C becomes more famous than all other languages.
So many of the programmers divorced the other
languages and happily married with C language.
Features of C Language
C is middle level language.
C is structured language.
C is case sensitive language.
C has compiler as a language translator.
C++ is hybrid language
First Program of C-Language
#include <iostream>
using namespace std ;
int main ()
{
cout <<"Hello World... \n " ;
system ("PAUSE") ;
return 0 ;
}
Explanation of First Program
#: It is a preprocessor directive

include: It is a name of directory

iostream: Built-in file, header iostream used to perform input

and output operations in screen

using : Keyword
Namespace: For directory
Std: library file

int: data type


main (): Entry point for every C++ / C program

{ // Open curly bracket of the main function


cout: output stream
<<: Operator
system (PAUSE): Built-in Function
}// Closing curley brackets
Compile and Execute
For compilation press CNTRL+F9

For compilation as well as execution press


CNTRL+F10

Compilation and Execution F9

For saving the program go to file and click on save.

By default file is saved with the extension of .CPP.


Escape Sequences
Certain special characters are represented as escape sequences.

An escape sequence begins with a \ (backslash) followed by an


alphanumeric character.

List of Escape Sequence characters


\n New Line
\t Horizontal tab
\r Carriage return
\ Double quotes
\ Single quote
\a Alert
\b Back space
\f Form feed
\v Vertical tab
\\ Back Slash
\? Question Mark
\000 Octal Number
\xhh HEXA decimal number
Comments
Single line comments
//

Multiple line comments


/* */
Recap of the lecture
History and Development of C-Language
Features of C-Language
First program of C-Language
Explanation of the program
How to open the C IDE
Escape Sequences (\n and \t)
Comments
Single Line Comments
Multiple Line Comments

Вам также может понравиться