what are keywords in c

          

What is Keyword in C Programming?

In C Programming,Keywords are nothing but reserved word which has special meaning assigned to it. Keywords are also known as Reserved word.Keywords are part of the syntax and they cannot be used as an identifier.In C,We have total 32 Keywords.As C is Case Sensitive Language all the keywords must be defined in lower case.Let's Understand Keyword With an example.

int rollno;

In above Eg  we have declared one variable of type int.In this Example int is keyword or Reserved word,In above eg we cannot use Int instead of int,Because we have already seen all the keywords must be defined in lower case.

What is Case Sensitivity in C Programming?

In Computer Programming,Case Sensitive defines both UpperCase and LowerCase letter  have different meaning.For Eg Hello and hello are different from each other.Let's understand with an example

int Age=12;

int age=23;

printf("%d",Age);

printf("%d",age);

In above eg,We have declared two variable of same name.But the memory location and value of both variable will be different because One Variable is defined  as UpperCase and other as LowerCase.I hope Now you got it what is Case Sensitivity in Programming.If you have still any doubt then feel free to ask on Comment.

Basic Usage of Keywords in C Programming:
 
return – This keyword is used for returning a value from a function.When this keyword is encountered  within a function the execution  will go to the position from where this function was called.All the  statement after this keyword will not be executed,Therefore it is recommended to use return keyword as a last statement of the  function.
 
goto – Used for redirecting the flow of execution from one place to another.This keyword is used with particular label.This is also Known Branching or Jump Statement.Let's Understand With an example.
 
goto a;
 
printf("Bye");
 
 a:
printf("Hello");
 
In above eg the control  will directly jump to a label and it will print Hello and it will ignore Bye Statement.
 
struct, typedef  – Both of these keywords used in structures (Grouping of data types in a single record).Struct keyword is used for creating user defined data type.We will learn more about structure in further class.
 
union – It is a collection of variables, which shares the same memory location and memory storage.It is similar to struct keyword.
 
enum – It is use to define Set of constants.  
 
for, while, do – types of loop structures in C.We will learn more about this in further class.
 
continue – It is generally used with for, while and dowhile loops, while execution of a program when compiler encounter this keyword it simply performs the next iteration of the loop and skip the rest of the instruction of the current iteration.  
 
auto, signed, const, extern, register, unsigned – This keywords are used to define the variable on different bases.For eg auto,extern and register are storage class.signed and unsigned are used to define variable on the basis of sign(+ve,-ve) of a number.const keyword is used to define constant variable.
  
int, float, char, double, long – These are the data types and used during variable declaration.Click here to Learn more about data type.
 
break – It is used in Loop and switch case statement.In loop,when the compiler encounter this keyword it simply break the current loop and control will come outside of the loop.In Switch Case,this keyword is used at the end of each case because if we will not use it then all the case after the matched case will be executed until next break statement is encounter.

if, else, switch, case, default – Used for decision control programming structure.We will learn more about this in further class.

void – One of the return type.void keyword specifies that the function does not return a value.
 
volatile :The volatile keyword is intended to prevent the compiler from applying any optimizations on objects that can change in ways that cannot be determined by the compiler.
 
sizeof – It is used to know the size.It returns the size of a variable.When sizeof() is used with the data types, it simply returns the amount of memory allocated to that data type.
 
short:The short keyword is type  modifier that alter the meaning of base data type by reducing the size of memory allocated by variable.

static:In C Programming,static keyword can be used with both variable and function i.e we can declare variable as static and static function.The main difference between non-static variable and static variable is static variable acts as a global variable and is shared among all the objects of the class while a non-static variables are specific to instance object in which they are created.The difference between static function and non-static function is Static means you do not have to instantiate (declare an object reference). That is, you can simply use the method,while the answer may be the same, the way you called that method/function is different.
 
If you any have doubt,suggestion regarding this post or website then feel free to share with us.
 
If you have learned something new from this post then share this post with your family and
friends.
 
Happy Learning :)😎    
 

Previous Next

11 Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Vitiligo Treatment
    MONOBENZONE Benoquin Vitiligo Treatment with Benoquik to Get results within 4 weeks with Benoquik 20% Cream High Quality, Fast Delivery in USA Benoquin Redues patches, makes skin natural glowing and helps to achieve uniform depigmentation, Skin Lighting agent,"

    ReplyDelete
  3. Want to Learn C Programming Course Online? Learn for Free online at learnVern.

    ReplyDelete
  4. Graffiti Brushes Procreate
    Look at our multiply graffiti brushes procreate determination for the absolute best in interesting or custom, carefully assembled pieces from our advanced shops.

    ReplyDelete
  5. Graffiti Brushes Procreate
    Look at our multiply graffiti brushes procreate determination for the absolute best in interesting or custom, carefully assembled pieces from our advanced shops.

    ReplyDelete
  6. App developers in Bangalore
    As one of the best mobile app development companies in Bangalore, we work with a wide range of brands in all industries. We will give an awesome idea and concept that will help your company reach the next level. Our app developers in Bangalore utilize interactive mobile layouts, pitch perfect development, and appropriate call-to-action buttons.

    ReplyDelete
  7. Graffiti Brushes Procreate
    Look at our multiply graffiti brushes procreate determination for the absolute best in interesting or custom, carefully assembled pieces from our advanced shops.

    ReplyDelete
  8. Graffiti Brushes Procreate
    Look at our multiply graffiti brushes procreate determination for the absolute best in interesting or custom, carefully assembled pieces from our advanced shops.

    ReplyDelete
  9. Graffiti Brushes Procreate
    Look at our multiply graffiti brushes procreate determination for the absolute best in interesting or custom, carefully assembled pieces from our advanced shops.

    ReplyDelete
  10. Nice blog, thanks for sharing this blog. Benoquin cream is applied to de-pigment the skin as a vitiligo treatment , Vitligo is a skin condition of irregular patches on skin, covering about 50% of the body surface, lose colour and become whitened.

    ReplyDelete
  11. Gyansetu's Programming courses are a fantastic way to kickstart your coding journey. With experienced instructors and a variety of programming languages to choose from, it's a great platform for honing your skills and embracing the world of coding. Highly recommended!


    For more info:- https://www.gyansetu.in/blogs/70-power-bi-mcq-and-answers-with-explanation/

    ReplyDelete
Previous Post Next Post