Basic Structure of C Language
and Related Term
By:Prof.Muhammad Waseem
Importance of Programming & Problem
Solving
• Here are some of the things that learning coding can empower someone to do-
• ToMake someone’s Own Website.
• Become a Career Coder.
• Start a Business
• Some of the kinds of businesses you can start include…
selling software
selling mobile apps
e-commerce
selling your coding time.
ToUnderstand How Computers Work and so more.
HEADER FILE
• A header file is a file with extension .h which contains C function declarations .
• There are two types of header files :
Files that the programmer writes and
Files that comes with a compiler.
• For Example:
stdio.h header file contains standard Input and Output functions.
string.h header file contains string handling functions.
Main function
• main() function is the entry point of any C program;
• It is the point at which execution of program is started;
• When a C program is executed, the execution control goes directly to the
main() function.
• Every C program have a main() function.
• It’s a compulsory for c program.
Simple example of a
program
Program Structure
• A sample of c program-
#include<stdio.h>
int main()
{
-----Statements----
// comments after double slash
}
Comments in c
• A comment is a programmer-readable explanation;
• They are added with the purpose of making the source code easier for humans to understand,
and are generally ignored by compilers and interpreters.
• Example-
• Single line comment-
//(double slash);
Multiline comment-
/*---------
------*/
• This can span over to multiple line;
Keywords in C Language
variables
• Variables are data that will keep on changing. A variable is nothing but a name given to a
storage area that our programs can manipulate.
• Declaration
<<Data type>> <<variable name>>;
int a;
• Definition
<<varname>>=<<value>>;
a=10;
• Usage
a=a+1; //increments the value of a by 1
Variable names-Rules
Constants
• Constants refer to fixed values that the program may not alter during its
execution. These fixed values are also called literals.
• Given below is the form to use #define preprocessor to define a
• const
• #define identifier value
Thanks!

Basic Structure of C Language and Related Term

  • 1.
    Basic Structure ofC Language and Related Term By:Prof.Muhammad Waseem
  • 2.
    Importance of Programming& Problem Solving • Here are some of the things that learning coding can empower someone to do- • ToMake someone’s Own Website. • Become a Career Coder. • Start a Business • Some of the kinds of businesses you can start include… selling software selling mobile apps e-commerce selling your coding time. ToUnderstand How Computers Work and so more.
  • 3.
    HEADER FILE • Aheader file is a file with extension .h which contains C function declarations . • There are two types of header files : Files that the programmer writes and Files that comes with a compiler. • For Example: stdio.h header file contains standard Input and Output functions. string.h header file contains string handling functions.
  • 4.
    Main function • main()function is the entry point of any C program; • It is the point at which execution of program is started; • When a C program is executed, the execution control goes directly to the main() function. • Every C program have a main() function. • It’s a compulsory for c program.
  • 5.
  • 6.
    Program Structure • Asample of c program- #include<stdio.h> int main() { -----Statements---- // comments after double slash }
  • 8.
    Comments in c •A comment is a programmer-readable explanation; • They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. • Example- • Single line comment- //(double slash); Multiline comment- /*--------- ------*/ • This can span over to multiple line;
  • 9.
    Keywords in CLanguage
  • 10.
    variables • Variables aredata that will keep on changing. A variable is nothing but a name given to a storage area that our programs can manipulate. • Declaration <<Data type>> <<variable name>>; int a; • Definition <<varname>>=<<value>>; a=10; • Usage a=a+1; //increments the value of a by 1
  • 11.
  • 12.
    Constants • Constants referto fixed values that the program may not alter during its execution. These fixed values are also called literals. • Given below is the form to use #define preprocessor to define a • const • #define identifier value
  • 13.