![]() |
How To Use C Keywords Lists Briefly Details |
How To Use C Keywords Lists Briefly Details
Example of All Keyword in C language in Full Details
auto: A auto keyword makes an automatic variable like.
auto int data;
This statement suggests that data is a variable of storage class auto and datatype int.
Automatic variables are local functions, they are also called local variables. so it is called the auto variable.
Some Others Languages Keywords
👉C++ Language Keywords
👉Java Language Keywords
👉Python Language Keywords
break: A break keyword statement terminates the loop immediately. The break statement ends the for a loop when the condition is false.
How To Use break Statement in C?
break;
1
continue Statement: A continue statement skips the value of the current iteration of the loop. continue statement is a print next iteration.
How To Use Continue Statement in C?
#include<stdio.h>
int main()
{
for(int i=1;i<=10;i++)
{
if(i==5)
{
printf("skip the 5 value of continue\n");
continue;
}
printf("%d\n",i);
}
}
*****OUTPUT*****
1
2
3
4
skip the 5 value of continue
6
7
8
9
10
switch case: A switch statement is used to check the condition. The switch statement is the very most useful statement. switch statements are multiple condition checks using a switch case.
Syntax of switch Statement
switch(expression)
{
case '1':
//case one execute ;
break;
case '3':
//case three execute;
break;
default:
//no case match is default case is executed;
}
How To Use Switch Statement in C?
#include<stdio.h>
int main()
{
int x=2;
switch(2)
{
case 1:
printf("case one executed");
break;
case 2:
printf("case two execuetd");
break;
case 3:
printf("case three executed");
default:
printf("value are not match");
}
}
*****OUTPUT*****
case two executed
char: A char keyword define the only character value.
char grade='A';
How To Use Char Keyword in C?
#include<stdio.h>
int main()
{
char grade='A';
printf("Student garde value:%c",grade);
}
*****OUTPUT*****
Student grade value:'A'
const: A const identifier can be declared a constant value using the const keyword. the constant value can not be changed.
const int data = 10;
How To Use const keyword in C?
#include<stdio.h>
int main()
{
const int data=10;
printf("The value of data:%d",data);
}
*****OUTPUT*****
The value of data:10
do-while: A do-while loop is a very useful loop. do-while loop used the repeat the value. when they do while loop the first time executes in the program given the condition.
Syntax do-while loop in C
do |
How To Use do-while loop in C?
#include<stdio.h> int main() { int i=1; do { printf("%d
",i); i++; } while(i<=10); } *****OUTPUT***** 1 2 3 4 5 6 7 8 9 10 |
double and float: double and float Keywords are used for declaring floating type value. double keywords are used the long number of value and float is used the floating-point value
double data=13.75356354;
float data=13.23;
How To Use double and float in C?
#include<stdio.h> int main() { double data=687537332; float d=53.2364; printf("Value of double number:%f\n",data); printf("Value of floting number:%f",d); } *****OUTPUT***** Value of double number:687537332.000000 Value of floating
number:53.236401 |
if and else: A if-else statement is used in the decision-making condition.if the statement executes the condition is true. otherwise else statements are executed. when condition false.
Syntax of if-else statement
if(condition) { //statement; } else { //statement; } |
How To Use if-else statement in C?
#include <stdio.h> int main() { int age; if (age<=18) { print("You can play the PUBG Game"); } else { print("You can not play the PUBG Game"); } return 0; }
*****OUTPUT***** You can play the
PUBG Game |
enum: A enum is the named integer constants. enum is a user-defined data type. enum is an Enumeration.
Syntax of Enumeration
enum enum_name{value1,value2,value3....value
n}; |
How To Use enum keyword in C?
#include<stdio.h> enum year { Jan,Feb,mar,api,may,June,July,Aug,sep,Oct,Nov,dec}; int main() { enum year data; data=June; printf("Value of june:%d",data); } *****OUTPUT***** Value of june:5 |
for loop: A for loop can be Using C Language. it is the
very most useful loop. Because for loop in an initiation condition and
increment/decrement only one line. so for loop is the most useful loop.
Syntax of for loop
for(initiation;condition;increment) for(int
i=1;i<=10;i++) |
How To Use for loop in C?
#include<stdio.h> int main() { for(int i=1;i<=10;i++) { printf("%d ",i); } }
1 2 3 4 5 6 7 8 9 10 |
extern: A extern keyword is used external linking outside of the file.
goto: The goto statement is a jump statement control of the program to another label of the program.
int: A int keyword is used the integer type value of the c Language.
return: The return keyword terminates the function and returns the value of the c program.
size of: A size of keyword has used the size of data.
register: A register keyword is used the quick access the data.it is very fast to retrieve the data from the computer. Because value stored the register.
static: A static variable is not reclaimed. They keep their value. On re-entry to the block, the variable will have its old value.
struct: A struct keyword is used for declaring a structure. A structure can behold the variables of different types with only a single name.
Syntax of structure
struct student { char name[80]; float marks; int age; }s1, s2; |
typedef: The C programming language provides a keyword called typedef which you can use to give a type a new name.
A typedef keyword can be used to long name to the small name change. typedef can be Using the short name of any long variables name.
union: Union is a data type in C programming that allows different data types to be stored in the same memory locations.
A union is used for grouping different types of variables under a single name. union is stored the single value stored. otherwise other value garbage value in the variables.
Syntax of union
student { Data type var1; Data type var2; Data type var3; }; |
void: Avoid keyword meaning nothing value. the void return type of the c program.
volatile: A volatile keyword is used for creating volatile objects. It can be used the change the value of hardware memory.