

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the different types of keywords in C language?
Keywords are generally called as pre-defined or reserved words in a programming language. Every keyword in C language performs a specific function in a program.
Keywords cannot be used as variable names.
Keywords have fixed meanings, and that meaning cannot be changed.
They are the building block of a 'C' program.
C supports 32 keywords.
All the keywords are written in lowercase letters.
The different types of keywords are as follows −
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
const | short | float | unsigned |
continue | for | signed | void |
default | goto | sizeof | volatile |
do | if | static | while |
Example
Given below is the C program for the Simple Calculator by using the Switch Case −
#include <stdio.h> int main(){ char Operator; float num1, num2, result = 0; printf("\n Try to Enter an Operator (+, -, *, /) : "); scanf("%c", &Operator); printf("\n Enter the Values for two Operands: "); scanf("%f%f", &num1, &num2); switch(Operator){ case '+': result = num1 + num2; break; case '-': result = num1 - num2; break; case '*': result = num1 * num2; break; case '/': result = num1 / num2; break; default: printf("\n entered operator is invalid "); } printf("\n The result of %.2f %c %.2f = %.2f", num1, Operator, num2, result); return 0; }
Output
When the above program is executed, it produces the following result −
Enter an Operator (+, -, *, /) : * Enter the Values for two Operands: 34 12 The result of 34.00 * 12.00 = 408.00
In the above example, the keywords that are used to perform a simple calculator program are as follows −
Int, char, switch, case, break, float, default, return
These words cannot be used as variables while writing the program.
- Related Questions & Answers
- What are the different types of keywords in Java?
- What are the different types of pointers in C language?
- What are different types of constants in C language?
- What are different types of data in C language?
- What are different types of constants in C++?
- What are the different types of psychotherapy?
- What are the different types of DBMS?
- What are the different types of ISDN?
- What are the different data types of arrays in C#?
- What are the different types of functions in C Programming?
- What are types of expressions evaluated in C Language?
- What are the different searching techniques in C language?
- What are the different computer languages in C language?
- What are different types of interrupts?
- What are Different Types of Testing?