Programming Fundamentals: Lecture No. 1
Programming Fundamentals: Lecture No. 1
Lecture No. 1
Short Profile
• Ph.D (Computer Networks):
University Technology Malaysia.
• Thesis Title:
Self Adaptive Resource Aware Routing Protocol in Delay
Tolerant Network
• Number of Publications (25)
2
PhD Thesis
SELF ADAPTIVE RESOURCE AWARE
ROUTING PROTOCOLS FOR DELAY TOLEARNT NETWORK
Publications
Publication (Impact
11
Factor)
Publication (Indexed
12
Journals)
Publication (Conference) 02
Post-Doctorate
CONTEXT CENTRIC RESOURCE
AWARE ROUTING PROTOCOLS FOR DELAY TOLERANT NETWORKS
• Traditional Languages
• Computer Languages
Traditional Languages ?
• English
• Pashto
• Urdu
• Punjabi
Computer Language ?
Types of Computer Language
• Low Level Language
• High Level Language
• #include <stdio.h>
• int main()
• {
• Printf(“Hello World”);
• Return 0;
• }
Data and Data Types
1. Int 2
2. Short 2
3. Long 4
4. Float 4
5. Double 8
6. Char 1
Constants variable and
keywords
• Constant
• Variables
• Keywords
What is Constant ?
• A value that cannot be changed during the
execution of a program is called as constant.
• How to declare constant in C program ?
• data type, const name_of_constant
• const data type name_of_constant
• Int const GRAVITY = 6.67
• Const int PI = 3.14
• Use UPPER CASE to name constants
Sample Program to demonstrate
Constant
• #include<stdio.h>
• #include<conio.h>
• Int main()
• {
– int const PI = 3.14;
– const int GRAVITY= 9.7;
• }
Placeholders
• Output place holder
• Input place holder
getche();
return 0;
}
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
const float pi= 3.14;
float const gravity=9.7;
int int_value = 10;
char ch = 'a';
printf("Enter value of int value");
scanf("%d",&int_value);
getche();
return 0;
}
Placeholder: address variable
#include<stdio.h>
#include<conio.h>
int main()
{clrscr();
const float pi= 3.14;
float const gravity=9.7;
int a, b, c;
a=b=c=1;
printf("\n");
printf("%x",&b);
printf("\n");
printf("%x",&c);
getche();
return 0; }
Achievement
We have understood Placeholders, constants,
keywords and character set
Variables
• A value that can be changed during the
execution of a program is called as constant.
• Declare
– data_type name_variable;
– Int a;
– Int a, b, c;
– Int a, b, c;
END