SlideShare a Scribd company logo
1 of 18
Download to read offline
Computing Fundamentals
Dr. Muhammad Yousaf Hamza
Qualification
• Postdoc.
Department of Electrical Engineering, University of Minnesota, Duluth, USA.
• Ph.D.
Lahore University of Management Sciences (LUMS), Lahore, Pakistan.
Carried one-year PhD research at University of Ottawa, Canada.
• MS (Computer Science)
Lahore University of Management Sciences (LUMS), Lahore, Pakistan.
(With Honors, Merit certificate was awarded)
• M.Phil. (Electronics)
Quaid-i-Azam University, Islamabad, Pakistan. (Merit Certificate was awarded)
• Post Graduate Course
Post-Graduate Course in Lasers and Optics, PIEAS, Nilore, Islamabad, Pakistan.
• B.Sc. Electrical Engineering
University of Engineering and Technology (UET), Lahore, Pakistan.
• F.Sc. Government College, Lahore.
Dr. Muhammad Yousaf Hamza
Course Contents
• Basic components of a computer
• Programming languages
• Introduction to operating system
• Programming in C with examples and
applications
Dr. Muhammad Yousaf Hamza
Text Books:
1) P. K. Sinha, Computer Fundamentals, BPB
Publications, 2004
2) Kernighan and Ritchie, The C Programming
Language
3) Yashwant Kanitkar, Let Us C
4) Bradley L. Jones and Peter Aitken , Teach
Yourself C in 21 Days, 6th Edition
Pre-Class Evaluation Form
Dr. Muhammad Yousaf Hamza
Objective of the Course
• To learn computer fundamentals
• To learn C language.
Why Learn C?
• C is the base language of most of the other
programming languages.
• To be a Good Programmer, one must know
fundamentals of C programming language.
• Simulations ----- lets us apply maths to the
real world.
Dr. Muhammad Yousaf Hamza
• Course related stuff is available on data server
of PIEAS
zambeel.pieas.edu.pk>FacultyShare>Muhammad
Yousaf Hamza Dr>Public> 1_CF Zero Semester
• We will use Dev_C
• Lab. Venue: Computer Centre (I –Block)
Information
Dr. Muhammad Yousaf Hamza
Let us Write First C Program
Dr. Muhammad Yousaf Hamza
Approach To Our First C Program
x = 5;
y = 7;
z = x + y;
x, y and z are integer variables
Dr. Muhammad Yousaf Hamza
Data Types
• Integer variables (int)
For example:
– Number of students
– Number of tables
• Floating point variables (float)
For quantities which may contain decimal point
such as distance, area, and temperature.
• Character variables (char)
At this stage, we will focus only on integers.
Dr. Muhammad Yousaf Hamza
Approach To Our First C Program
x = 5;
y = 7;
z = x + y;
x, y and z are integer variables
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z;
x = 5;
y = 7;
z = x + y;
printf(“%d", z);
getchar();
return 0;
}
//Our First C Program
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z;
x = 5;
y = 7;
z = x + y;
printf(“%d", z);
getchar();
return 0;
}
12
//Our First C Program
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z;
x = 5;
y = 7;
z = x + y;
printf(“Sum is %d", z); // Compare it with printf(“%d", z);
getchar();
return 0;
}
Sum is 12
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z, m;
x = 5;
y = 7;
z = x + y;
m = x - y;
printf("Sum is %d", z);
printf("Difference is %d", m);
getchar();
return 0;
}
Sum is 12Difference is -2
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z, m;
x = 5;
y = 7;
z = x + y;
m = x - y;
printf("Sum is %dn", z);
printf("Difference is %d", m);
getchar();
return 0;
}
Sum is 12
Difference is -2
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z, m;
x = 5;
y = 7;
z = x + y;
m = x - y;
printf("Sum is %dnDifference is %d", z, m); // two outputs in
//one printf
getchar();
return 0;
}
What’s output?
S
Dr. Muhammad Yousaf Hamza
#include <stdio.h>
int main( )
{
int x, y, z, m;
x = 5;
y = 7;
z = x + y;
m = x - y;
printf("Sum is %dnDifference is %d", z, m); // two outputs in
//one printf
getchar();
return 0;
}
What’s output?
Sum is 12
Difference is -2 Dr. Muhammad Yousaf Hamza

More Related Content

Similar to C Language Lecture 1

lecture_mooney.ppt
lecture_mooney.pptlecture_mooney.ppt
lecture_mooney.ppt
butest
 
DavidEverhart-abyssinica
DavidEverhart-abyssinicaDavidEverhart-abyssinica
DavidEverhart-abyssinica
David Everhart
 
Bca2020 data structure and algorithm
Bca2020   data structure and algorithmBca2020   data structure and algorithm
Bca2020 data structure and algorithm
smumbahelp
 

Similar to C Language Lecture 1 (20)

Cpp Study Jam
Cpp Study JamCpp Study Jam
Cpp Study Jam
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Lecture02 - Fundamental Programming with Python Language
Lecture02 - Fundamental Programming with Python LanguageLecture02 - Fundamental Programming with Python Language
Lecture02 - Fundamental Programming with Python Language
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 
Survey of programming language getting started in C
Survey of programming language getting started in CSurvey of programming language getting started in C
Survey of programming language getting started in C
 
270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functions270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functions
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 
Python Basics.pdf
Python Basics.pdfPython Basics.pdf
Python Basics.pdf
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
 
lecture_mooney.ppt
lecture_mooney.pptlecture_mooney.ppt
lecture_mooney.ppt
 
Ece 1322 programming_for_engineers_s1_201213(1)
Ece 1322 programming_for_engineers_s1_201213(1)Ece 1322 programming_for_engineers_s1_201213(1)
Ece 1322 programming_for_engineers_s1_201213(1)
 
Chapter 2 ds
Chapter 2 dsChapter 2 ds
Chapter 2 ds
 
UNIT1-JAVA.pptx
UNIT1-JAVA.pptxUNIT1-JAVA.pptx
UNIT1-JAVA.pptx
 
DavidEverhart-abyssinica
DavidEverhart-abyssinicaDavidEverhart-abyssinica
DavidEverhart-abyssinica
 
Bca2020 data structure and algorithm
Bca2020   data structure and algorithmBca2020   data structure and algorithm
Bca2020 data structure and algorithm
 
OOPJ.pptx
OOPJ.pptxOOPJ.pptx
OOPJ.pptx
 
Fosdem 2013 petra selmer flexible querying of graph data
Fosdem 2013 petra selmer   flexible querying of graph dataFosdem 2013 petra selmer   flexible querying of graph data
Fosdem 2013 petra selmer flexible querying of graph data
 
Software Testing:
 A Research Travelogue 
(2000–2014)
Software Testing:
 A Research Travelogue 
(2000–2014)Software Testing:
 A Research Travelogue 
(2000–2014)
Software Testing:
 A Research Travelogue 
(2000–2014)
 
Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)
 

More from Shahzaib Ajmal (16)

C Language Lecture 22
C Language Lecture 22C Language Lecture 22
C Language Lecture 22
 
C Language Lecture 20
C Language Lecture 20C Language Lecture 20
C Language Lecture 20
 
C Language Lecture 19
C Language Lecture 19C Language Lecture 19
C Language Lecture 19
 
C Language Lecture 18
C Language Lecture 18C Language Lecture 18
C Language Lecture 18
 
C Language Lecture 17
C Language Lecture 17C Language Lecture 17
C Language Lecture 17
 
C Language Lecture 15
C Language Lecture 15C Language Lecture 15
C Language Lecture 15
 
C Language Lecture 14
C Language Lecture 14C Language Lecture 14
C Language Lecture 14
 
C Language Lecture 13
C Language Lecture 13C Language Lecture 13
C Language Lecture 13
 
C Language Lecture 12
C Language Lecture 12C Language Lecture 12
C Language Lecture 12
 
C Language Lecture 11
C Language Lecture  11C Language Lecture  11
C Language Lecture 11
 
C Language Lecture 10
C Language Lecture 10C Language Lecture 10
C Language Lecture 10
 
C Language Lecture 9
C Language Lecture 9C Language Lecture 9
C Language Lecture 9
 
C Language Lecture 8
C Language Lecture 8C Language Lecture 8
C Language Lecture 8
 
C Language Lecture 7
C Language Lecture 7C Language Lecture 7
C Language Lecture 7
 
C Language Lecture 6
C Language Lecture 6C Language Lecture 6
C Language Lecture 6
 
C Language Lecture 4
C Language Lecture  4C Language Lecture  4
C Language Lecture 4
 

Recently uploaded

會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 

Recently uploaded (20)

會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 

C Language Lecture 1

  • 2. Qualification • Postdoc. Department of Electrical Engineering, University of Minnesota, Duluth, USA. • Ph.D. Lahore University of Management Sciences (LUMS), Lahore, Pakistan. Carried one-year PhD research at University of Ottawa, Canada. • MS (Computer Science) Lahore University of Management Sciences (LUMS), Lahore, Pakistan. (With Honors, Merit certificate was awarded) • M.Phil. (Electronics) Quaid-i-Azam University, Islamabad, Pakistan. (Merit Certificate was awarded) • Post Graduate Course Post-Graduate Course in Lasers and Optics, PIEAS, Nilore, Islamabad, Pakistan. • B.Sc. Electrical Engineering University of Engineering and Technology (UET), Lahore, Pakistan. • F.Sc. Government College, Lahore. Dr. Muhammad Yousaf Hamza
  • 3. Course Contents • Basic components of a computer • Programming languages • Introduction to operating system • Programming in C with examples and applications Dr. Muhammad Yousaf Hamza
  • 4. Text Books: 1) P. K. Sinha, Computer Fundamentals, BPB Publications, 2004 2) Kernighan and Ritchie, The C Programming Language 3) Yashwant Kanitkar, Let Us C 4) Bradley L. Jones and Peter Aitken , Teach Yourself C in 21 Days, 6th Edition
  • 5. Pre-Class Evaluation Form Dr. Muhammad Yousaf Hamza
  • 6. Objective of the Course • To learn computer fundamentals • To learn C language. Why Learn C? • C is the base language of most of the other programming languages. • To be a Good Programmer, one must know fundamentals of C programming language. • Simulations ----- lets us apply maths to the real world. Dr. Muhammad Yousaf Hamza
  • 7. • Course related stuff is available on data server of PIEAS zambeel.pieas.edu.pk>FacultyShare>Muhammad Yousaf Hamza Dr>Public> 1_CF Zero Semester • We will use Dev_C • Lab. Venue: Computer Centre (I –Block) Information Dr. Muhammad Yousaf Hamza
  • 8. Let us Write First C Program Dr. Muhammad Yousaf Hamza
  • 9. Approach To Our First C Program x = 5; y = 7; z = x + y; x, y and z are integer variables Dr. Muhammad Yousaf Hamza
  • 10. Data Types • Integer variables (int) For example: – Number of students – Number of tables • Floating point variables (float) For quantities which may contain decimal point such as distance, area, and temperature. • Character variables (char) At this stage, we will focus only on integers. Dr. Muhammad Yousaf Hamza
  • 11. Approach To Our First C Program x = 5; y = 7; z = x + y; x, y and z are integer variables Dr. Muhammad Yousaf Hamza
  • 12. #include <stdio.h> int main( ) { int x, y, z; x = 5; y = 7; z = x + y; printf(“%d", z); getchar(); return 0; } //Our First C Program Dr. Muhammad Yousaf Hamza
  • 13. #include <stdio.h> int main( ) { int x, y, z; x = 5; y = 7; z = x + y; printf(“%d", z); getchar(); return 0; } 12 //Our First C Program Dr. Muhammad Yousaf Hamza
  • 14. #include <stdio.h> int main( ) { int x, y, z; x = 5; y = 7; z = x + y; printf(“Sum is %d", z); // Compare it with printf(“%d", z); getchar(); return 0; } Sum is 12 Dr. Muhammad Yousaf Hamza
  • 15. #include <stdio.h> int main( ) { int x, y, z, m; x = 5; y = 7; z = x + y; m = x - y; printf("Sum is %d", z); printf("Difference is %d", m); getchar(); return 0; } Sum is 12Difference is -2 Dr. Muhammad Yousaf Hamza
  • 16. #include <stdio.h> int main( ) { int x, y, z, m; x = 5; y = 7; z = x + y; m = x - y; printf("Sum is %dn", z); printf("Difference is %d", m); getchar(); return 0; } Sum is 12 Difference is -2 Dr. Muhammad Yousaf Hamza
  • 17. #include <stdio.h> int main( ) { int x, y, z, m; x = 5; y = 7; z = x + y; m = x - y; printf("Sum is %dnDifference is %d", z, m); // two outputs in //one printf getchar(); return 0; } What’s output? S Dr. Muhammad Yousaf Hamza
  • 18. #include <stdio.h> int main( ) { int x, y, z, m; x = 5; y = 7; z = x + y; m = x - y; printf("Sum is %dnDifference is %d", z, m); // two outputs in //one printf getchar(); return 0; } What’s output? Sum is 12 Difference is -2 Dr. Muhammad Yousaf Hamza