SlideShare a Scribd company logo
1 of 25
Download to read offline
Presented By
MR. SURAJ KUMAR
BCA, PGDCA & MCA
Mob- 7677308200
Email- suraj0616@gmail.com
LECTURE-2
Keywords
Keyword
Keywords are predefined, reserved words used in
programming that have special meanings to the
compiler. Keywords are part of the syntax and they
cannot be used as an identifier.
The keywords cannot be used as variable names
because if we do so, we are trying to assign a new
meaning to the keyword, which is not allowed by the
computer.
Keywords in C
auto break case char
const continue default do
double else enum extern
float for goto if
int long register return
short signed sizeof static
struct switch typedef union
unsigned void volatile while
auto
The auto keyword declares automatic variables. For
example:
auto int var1;
This statement suggests that var1 is a variable of storage
class auto and type int.
Variables declared within function bodies are automatic by
default. They are recreated each time a function is executed.
Since automatic variables are local to a function, they are
also called local variables.
break and continue
The break statement terminates the innermost loop
immediately when it's encountered. It's also used to
terminate the switch statement.
The continue statement skips the statements after it inside
the loop for the iteration.
for (i=1;i<=10;++i) {
if (i==4)
continue;
if (i==7)
break;
printf("%d ",i);
}
Output: 1 2 3 5 6
When i is equal to 4, the continue statement comes into
effect and skips 4. When i is equal to 7, the break
statement comes into effect and terminates the for
loop.
switch, case and default
The switch and case statement is used when a block of
statements has to be executed among many blocks. For
example:
switch(expression)
{
case '1':
//some statements to execute when 1
break;
case '5':
//some statements to execute when 5
break;
default:
//some statements to execute when default;
}
char
The char keyword declares a character variable. For
example:
char alphabet;
Here, alphabet is a character type variable.
const
An identifier can be declared constant by using the
const keyword.
const int i = 5;
do….while
int i;
do
{
printf("%d ",i);
i++;
}
while (i<10)
double and float
Keywords double and float are used for declaring
floating type variables. For example:
float number;
double longNumber;
Here, number is a single-precision floating type
variable whereas, longNumber is a double-precision
floating type variable.
if and else
Keywords double and float are used for declaring
floating type variables. For example:
float number;
double longNumber;
Here, number is a single-precision floating type
variable whereas, longNumber is a double-precision
floating type variable.
enum
enum
Enumeration types are declared in C programming
using keyword enum. For example:
enum suit
{
hearts;
spades;
clubs;
diamonds;
};
Here, an enumerated variable suit is created having
tags: hearts, spades, clubs, and diamonds.
extern
The extern keyword declares that a variable or a
function has external linkage outside of the file it is
declared.
for
There are three types of loops in C programming. The
for loop is written in C programming using the
keyword for. For example:
for (i=0; i< 9;++i)
{
printf("%d ",i);
}
Output: 0 1 2 3 4 5 6 7 8
goto
The goto statement is used to transfer control of the
program to the specified label. For example:
for(i=1; i<5; ++i)
{
if (i==10)
goto error;
}
printf("i is not 10");
error:
printf("Error, count cannot be 10.");
Output: Error, count cannot be 10.
int
The int keyword is used to declare integer type
variables. For example:
int count;
Here, count is an integer variable.
short, long, signed and unsigned
The short, long, signed and unsigned keywords are
type modifiers that alter the meaning of a base data
type to yield a new type.
short int smallInteger;
long int bigInteger;
signed int normalInteger;
unsigned int positiveInteger;
Range of int data types
Data types Range
short int -32768 to 32767
long int -2147483648 to 214743648
signed int -32768 to 32767
unsigned int 0 to 65535
return
The return keyword terminates the function and
returns the value.
int func()
{
int b = 5;
return b;
}
This function func() returns 5 to the calling
function.
sizeof
The sizeof keyword evaluates the size of data (a
variable or a constant).
#include <stdio.h>
int main()
{
printf("%u bytes.",sizeof(char));
}
Output: 1 bytes.
register
The register keyword creates register variables
which are much faster than normal variables.
For example:
register int var1;
static
The static keyword creates a static variable. The
value of the static variables persists until the end
of the program. For example:
static int var;
struct
The struct keyword is used for declaring a
structure. A structure can hold variables of
different types under a single name.
struct student
{
char name[80];
float marks;
int age;
} s1, s2;
typedef
The typedef keyword is used to explicitly associate a
type with an identifier.
typedef float kg;
kg bear, tiger;
union
A union is used for grouping different types of variables
under a single name.
union student
{
char name[80];
float marks;
int age;
}
void
The void keyword meaning nothing or no value.
void testFunction(int a)
{
.....
}
Here, the testFunction() function cannot return a value
because its return type is void.
volatile
The volatile keyword is used for creating volatile
objects. A volatile object can be modified in an
unspecified way by the hardware.
const volatile number
Here, number is a volatile object.
Since number is a constant, the program cannot
change it. However, hardware can change it since it is a
volatile object.
Lecture 2 keyword of C Programming Language

More Related Content

What's hot (20)

What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 
Forloop
ForloopForloop
Forloop
 
Data types
Data typesData types
Data types
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
C Pointers
C PointersC Pointers
C Pointers
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
Pointers in C Programming
Pointers in C ProgrammingPointers in C Programming
Pointers in C Programming
 
C programming language
C programming languageC programming language
C programming language
 
Typedef
TypedefTypedef
Typedef
 
Data types
Data typesData types
Data types
 
01 c++ Intro.ppt
01 c++ Intro.ppt01 c++ Intro.ppt
01 c++ Intro.ppt
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Data types in C
Data types in CData types in C
Data types in C
 
Storage class
Storage classStorage class
Storage class
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
Type conversion
Type conversionType conversion
Type conversion
 
Type conversion
Type  conversionType  conversion
Type conversion
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 

Similar to Lecture 2 keyword of C Programming Language

Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptxvijayapraba1
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageRakesh Roshan
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variablesyarkhosh
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cppsharvivek
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpen Gurukul
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2ndConnex
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming FundamentalsHassan293
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 
Unit 1 question and answer
Unit 1 question and answerUnit 1 question and answer
Unit 1 question and answerVasuki Ramasamy
 
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)guest58c84c
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)jahanullah
 

Similar to Lecture 2 keyword of C Programming Language (20)

Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
C interview questions
C interview  questionsC interview  questions
C interview questions
 
Data type
Data typeData type
Data type
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2nd
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
C tokens
C tokensC tokens
C tokens
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Unit 1 question and answer
Unit 1 question and answerUnit 1 question and answer
Unit 1 question and answer
 
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Lecture 2 keyword of C Programming Language

  • 1. Presented By MR. SURAJ KUMAR BCA, PGDCA & MCA Mob- 7677308200 Email- suraj0616@gmail.com LECTURE-2
  • 3. Keyword Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier. The keywords cannot be used as variable names because if we do so, we are trying to assign a new meaning to the keyword, which is not allowed by the computer.
  • 4. Keywords in C auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
  • 5. auto The auto keyword declares automatic variables. For example: auto int var1; This statement suggests that var1 is a variable of storage class auto and type int. Variables declared within function bodies are automatic by default. They are recreated each time a function is executed. Since automatic variables are local to a function, they are also called local variables.
  • 6. break and continue The break statement terminates the innermost loop immediately when it's encountered. It's also used to terminate the switch statement. The continue statement skips the statements after it inside the loop for the iteration. for (i=1;i<=10;++i) { if (i==4) continue; if (i==7) break; printf("%d ",i); } Output: 1 2 3 5 6
  • 7. When i is equal to 4, the continue statement comes into effect and skips 4. When i is equal to 7, the break statement comes into effect and terminates the for loop.
  • 8. switch, case and default The switch and case statement is used when a block of statements has to be executed among many blocks. For example: switch(expression) { case '1': //some statements to execute when 1 break; case '5': //some statements to execute when 5 break; default: //some statements to execute when default; }
  • 9. char The char keyword declares a character variable. For example: char alphabet; Here, alphabet is a character type variable. const An identifier can be declared constant by using the const keyword. const int i = 5;
  • 11. double and float Keywords double and float are used for declaring floating type variables. For example: float number; double longNumber; Here, number is a single-precision floating type variable whereas, longNumber is a double-precision floating type variable.
  • 12. if and else Keywords double and float are used for declaring floating type variables. For example: float number; double longNumber; Here, number is a single-precision floating type variable whereas, longNumber is a double-precision floating type variable.
  • 13. enum enum Enumeration types are declared in C programming using keyword enum. For example: enum suit { hearts; spades; clubs; diamonds; }; Here, an enumerated variable suit is created having tags: hearts, spades, clubs, and diamonds.
  • 14. extern The extern keyword declares that a variable or a function has external linkage outside of the file it is declared. for There are three types of loops in C programming. The for loop is written in C programming using the keyword for. For example: for (i=0; i< 9;++i) { printf("%d ",i); } Output: 0 1 2 3 4 5 6 7 8
  • 15. goto The goto statement is used to transfer control of the program to the specified label. For example: for(i=1; i<5; ++i) { if (i==10) goto error; } printf("i is not 10"); error: printf("Error, count cannot be 10."); Output: Error, count cannot be 10.
  • 16. int The int keyword is used to declare integer type variables. For example: int count; Here, count is an integer variable. short, long, signed and unsigned The short, long, signed and unsigned keywords are type modifiers that alter the meaning of a base data type to yield a new type. short int smallInteger; long int bigInteger; signed int normalInteger; unsigned int positiveInteger;
  • 17. Range of int data types Data types Range short int -32768 to 32767 long int -2147483648 to 214743648 signed int -32768 to 32767 unsigned int 0 to 65535
  • 18. return The return keyword terminates the function and returns the value. int func() { int b = 5; return b; } This function func() returns 5 to the calling function.
  • 19. sizeof The sizeof keyword evaluates the size of data (a variable or a constant). #include <stdio.h> int main() { printf("%u bytes.",sizeof(char)); } Output: 1 bytes.
  • 20. register The register keyword creates register variables which are much faster than normal variables. For example: register int var1; static The static keyword creates a static variable. The value of the static variables persists until the end of the program. For example: static int var;
  • 21. struct The struct keyword is used for declaring a structure. A structure can hold variables of different types under a single name. struct student { char name[80]; float marks; int age; } s1, s2;
  • 22. typedef The typedef keyword is used to explicitly associate a type with an identifier. typedef float kg; kg bear, tiger; union A union is used for grouping different types of variables under a single name. union student { char name[80]; float marks; int age; }
  • 23. void The void keyword meaning nothing or no value. void testFunction(int a) { ..... } Here, the testFunction() function cannot return a value because its return type is void.
  • 24. volatile The volatile keyword is used for creating volatile objects. A volatile object can be modified in an unspecified way by the hardware. const volatile number Here, number is a volatile object. Since number is a constant, the program cannot change it. However, hardware can change it since it is a volatile object.