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
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