SlideShare a Scribd company logo
C programming language for beginners
Instructions are very much similar to sentences/statements in
English language. It is the combination of various tokens,
character set elements to perform a desired task/output to
help a program make it complete.
OR
Instructions in C are the commands in the program that will
instruct C compiler to perform specific tasks or actions.
Whenever we write a C instruction, we are telling C compiler
to do a task for us.
Following are the categories of instructions:
 Declaration instructions
 Input/output instructions
 Assignment instructions
 Arithmetic/logical instructions
 Control instructions
These are used to declare different kind of variable
further to be used by the C program.
Eg:- we want to make a program and declare the variable
suppose, we want to write the area of rectangle. So the
declaration is
int A, B, Area;
OR
int l, b, area;
We want to add two numbers, then the declarations is
int A, B, sum;
Input instructions are used for supplying values to the
variables as declared in declarative instructions.
Eg:- (Statically supplying the values to the variables)
A=10;
B=20;
Where the values of variables are fixed.
(for dynamically supplying the value)
then we use a C library function called scanf( )
output instructions are used for printing the output after the
execution of instructions.
Then we use a C library function called printf( );
These are used for assigning the values in proper order to the
variables.
int A, B, C;
printf(“Enter the first number”);
scanf(“%d”,&A);
printf(“Enter the second number”);
scanf(“%d”,&B);
printf(“Enter the third number”);
scanf(“%d”,&C);
These are used for applying the arithmetic formula or logic to
solve the problems.
Eg:- we need to give a logical instruction to out program
area=l * b;
OR
area = A * B;
These are used to control the flow of execution of the
program.
SR.NO
.
TYPES & DESCRIPTION
1 Basic Types
They are arithmetic types and are further classified into: (a)
integer types and (b) floating-point types.
2 Enumerated types
It is a user defined data type. It gives numbers to the name.
3 The type void
The type especifier void indicates that no value is available.
4 Derived types
They include (a) Pointer types, (b) Array types, (c) Structure
types, (d) Union types (e) Function types.
TYPE SIZE RANGE FORMAT
SPECIFIER
Int or signed int 2 -32768 to 32767 %d,%i
Unsigned int 2 0 to 65535 %u
Short int or signed
short int
1 -128 to 127 %hd
Unsigned short int 1 0 to 255 %hu
Long int or signed
long int
4 -2,147,483,648 to
2,147,483,647
%ld
Unsigned long int 4 0 to 4,294,967,295 %lu
Float 4 3.4E-38 to 3.4E+38 %f
Double 8 1.7E-308 to
1.7E+308
%lf
Long double 10 3.4E-4932 to
1.1E+4932
%Lf or %LF
Char or signed char 1 -128 to 127 %c
Unsigned char 1 0 to 255 %c
#include<stdio.h>
#include<conio.h>
void main( )
{
int A, B, C;
clrscr( );
printf(“Enter the first number-”);
scanf(“%d”,&A);
printf(“Enter the second number-”);
scanf(“%d”,&B);
C=A+B;
printf(“%d”,C);
getch( );
}
Header section
Program execution starts with main( ) function
Declaration section
Clearing the screen function
Assignment section
Arithmetic section
Printing output statement
Take input from keyboard
Body
section
stdio.h
Standard input output header file
This header files contains the definition of standard
Input output functions used by a C program.
Eg:- printf( ); scanf( );
Output Input
conio.h
Console input ouput header file
This header file contains the definition of standard
input output functions used by C program related to
console input output devices.
Eg:- keyboard for input
monitor for output
The function needed for supplying the input data via
keyboard and to get output data via monitor are
defined inside <conio.h> library header file.
clrscr( ); getch( );
Clear the
screen
Get character
void main( )
C compiler starts its compilation from main( ).
Before compilation these is another process known
as pre-processing takes place.
During pre-processing, the header files are to be
declared in this section.
Some important points to be noted while you make any
program
 C program is case sensitive
 All the statements are end with semicolon ( ; )
 You must have to include header files
 Space values are ignored in C.

More Related Content

PPT
Programación no1
PPTX
Introduction to c
PPT
Ch1 principles of software development
PPS
Learn C
PPT
Fundamentals of Programming Chapter 3
PPT
Problem Solving Techniques
PPTX
Overview of C Mrs Sowmya Jyothi
PPT
Declaration of variables
Programación no1
Introduction to c
Ch1 principles of software development
Learn C
Fundamentals of Programming Chapter 3
Problem Solving Techniques
Overview of C Mrs Sowmya Jyothi
Declaration of variables

What's hot (20)

DOC
PPTX
datatypes and variables in c language
PDF
Assignment2
PPT
La5 Basicelement
PDF
Assignment5
PPT
Ch2 introduction to c
PPT
Ch3 repetition
PDF
Modula 2 tutorial - 003 - declarations
PPT
Flowchart - Introduction and Designing Tools
PDF
Casa lab manual
PDF
Handout#09
PPT
Variables in C Programming
PPTX
COMPUTER PROGRAMMING
PDF
CP Handout#2
PDF
C programming | Class 8 | III Term
PDF
CP Handout#1
PPTX
COM1407: Program Control Structures – Decision Making & Branching
PPSX
Complete C programming Language Course
PDF
programming fortran 77 Slide01
PDF
Fortran 90 Basics
datatypes and variables in c language
Assignment2
La5 Basicelement
Assignment5
Ch2 introduction to c
Ch3 repetition
Modula 2 tutorial - 003 - declarations
Flowchart - Introduction and Designing Tools
Casa lab manual
Handout#09
Variables in C Programming
COMPUTER PROGRAMMING
CP Handout#2
C programming | Class 8 | III Term
CP Handout#1
COM1407: Program Control Structures – Decision Making & Branching
Complete C programming Language Course
programming fortran 77 Slide01
Fortran 90 Basics
Ad

Similar to C programming language for beginners (20)

PPTX
Sample for Simple C Program - R.D.Sivakumar
PPT
Fundamental of C Programming Language and Basic Input/Output Function
PPT
Unit 4 Foc
PPT
Introduction to C Programming
PPTX
Programming_in_C_language_Unit5.pptx course ATOT
PPSX
C basics 4 std11(GujBoard)
PPT
Chapter3
PDF
Principals of Programming in CModule -5.pdfModule-3.pdf
DOCX
UNIT-II CP DOC.docx
PPTX
C Programming - Basics of c -history of c
PDF
C programing Tutorial
PPTX
Unit 2- Module 2.pptx
PPTX
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
PDF
C programming
PPTX
C programming
PPTX
unit_2 (1).pptx
PPTX
C Programming Unit-1
PPTX
Unit 2 CMath behind coding.pptx
PDF
java or oops class not in kerala polytechnic 4rth semester nots j
PPTX
Chapter1.pptx
Sample for Simple C Program - R.D.Sivakumar
Fundamental of C Programming Language and Basic Input/Output Function
Unit 4 Foc
Introduction to C Programming
Programming_in_C_language_Unit5.pptx course ATOT
C basics 4 std11(GujBoard)
Chapter3
Principals of Programming in CModule -5.pdfModule-3.pdf
UNIT-II CP DOC.docx
C Programming - Basics of c -history of c
C programing Tutorial
Unit 2- Module 2.pptx
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
C programming
C programming
unit_2 (1).pptx
C Programming Unit-1
Unit 2 CMath behind coding.pptx
java or oops class not in kerala polytechnic 4rth semester nots j
Chapter1.pptx
Ad

Recently uploaded (20)

PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Indian roads congress 037 - 2012 Flexible pavement
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
advance database management system book.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Empowerment Technology for Senior High School Guide
PPTX
Lesson notes of climatology university.
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Computing-Curriculum for Schools in Ghana
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Indian roads congress 037 - 2012 Flexible pavement
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
advance database management system book.pdf
RMMM.pdf make it easy to upload and study
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Empowerment Technology for Senior High School Guide
Lesson notes of climatology university.
Weekly quiz Compilation Jan -July 25.pdf
History, Philosophy and sociology of education (1).pptx
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Paper A Mock Exam 9_ Attempt review.pdf.
Computing-Curriculum for Schools in Ghana

C programming language for beginners

  • 2. Instructions are very much similar to sentences/statements in English language. It is the combination of various tokens, character set elements to perform a desired task/output to help a program make it complete. OR Instructions in C are the commands in the program that will instruct C compiler to perform specific tasks or actions. Whenever we write a C instruction, we are telling C compiler to do a task for us.
  • 3. Following are the categories of instructions:  Declaration instructions  Input/output instructions  Assignment instructions  Arithmetic/logical instructions  Control instructions
  • 4. These are used to declare different kind of variable further to be used by the C program. Eg:- we want to make a program and declare the variable suppose, we want to write the area of rectangle. So the declaration is int A, B, Area; OR int l, b, area; We want to add two numbers, then the declarations is int A, B, sum;
  • 5. Input instructions are used for supplying values to the variables as declared in declarative instructions. Eg:- (Statically supplying the values to the variables) A=10; B=20; Where the values of variables are fixed. (for dynamically supplying the value) then we use a C library function called scanf( ) output instructions are used for printing the output after the execution of instructions. Then we use a C library function called printf( );
  • 6. These are used for assigning the values in proper order to the variables. int A, B, C; printf(“Enter the first number”); scanf(“%d”,&A); printf(“Enter the second number”); scanf(“%d”,&B); printf(“Enter the third number”); scanf(“%d”,&C);
  • 7. These are used for applying the arithmetic formula or logic to solve the problems. Eg:- we need to give a logical instruction to out program area=l * b; OR area = A * B; These are used to control the flow of execution of the program.
  • 8. SR.NO . TYPES & DESCRIPTION 1 Basic Types They are arithmetic types and are further classified into: (a) integer types and (b) floating-point types. 2 Enumerated types It is a user defined data type. It gives numbers to the name. 3 The type void The type especifier void indicates that no value is available. 4 Derived types They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types (e) Function types.
  • 9. TYPE SIZE RANGE FORMAT SPECIFIER Int or signed int 2 -32768 to 32767 %d,%i Unsigned int 2 0 to 65535 %u Short int or signed short int 1 -128 to 127 %hd Unsigned short int 1 0 to 255 %hu Long int or signed long int 4 -2,147,483,648 to 2,147,483,647 %ld Unsigned long int 4 0 to 4,294,967,295 %lu Float 4 3.4E-38 to 3.4E+38 %f Double 8 1.7E-308 to 1.7E+308 %lf Long double 10 3.4E-4932 to 1.1E+4932 %Lf or %LF Char or signed char 1 -128 to 127 %c Unsigned char 1 0 to 255 %c
  • 10. #include<stdio.h> #include<conio.h> void main( ) { int A, B, C; clrscr( ); printf(“Enter the first number-”); scanf(“%d”,&A); printf(“Enter the second number-”); scanf(“%d”,&B); C=A+B; printf(“%d”,C); getch( ); } Header section Program execution starts with main( ) function Declaration section Clearing the screen function Assignment section Arithmetic section Printing output statement Take input from keyboard Body section
  • 11. stdio.h Standard input output header file This header files contains the definition of standard Input output functions used by a C program. Eg:- printf( ); scanf( ); Output Input
  • 12. conio.h Console input ouput header file This header file contains the definition of standard input output functions used by C program related to console input output devices. Eg:- keyboard for input monitor for output The function needed for supplying the input data via keyboard and to get output data via monitor are defined inside <conio.h> library header file. clrscr( ); getch( ); Clear the screen Get character
  • 13. void main( ) C compiler starts its compilation from main( ). Before compilation these is another process known as pre-processing takes place. During pre-processing, the header files are to be declared in this section. Some important points to be noted while you make any program  C program is case sensitive  All the statements are end with semicolon ( ; )  You must have to include header files  Space values are ignored in C.