15. GOTO KEYWORD –
goto is one of the C keywords which we use in goto statement. The goto statement is an unconditional control statement. It transfers the flow of control to another part of the program.
The goto keyword provides an unconditional jump to a statement present inside a function.
…. …. ….
…. …. ….
…… ….. ….
…… ….. ….
Here, label is any valid C identifier which follows by a colon. Whenever the statement goto label encounters, the compiler transfers the control to the statement which is immediately after the label.
printf(“number is even”);
printf(“number is odd”);
NOTE: Generally, Structured programming does not favours the use of goto statement. Certainly, we can always perform our jobs without using goto.
16. IF STATEMENT –
Likewise else, if is one of the C keywords which we use in if…else statement. Basically, if statement is one of the four control statements in C Language.
Generally, an if statement checks or tests a condition and executes the statement if the condition is true. Also, we should remember that in C any nonzero value is taken as True while zero is taken as False.
…. …. …. …
Here, we can have a single statement or a block of statements after the if part. Furthermore, if the condition is true i.e. nonzero then the compiler executes the statements of if part.
printf(“THE NUMBER IS SMALLER THAN 20”);
Here in the given if part, a condition is true. Therefore, the compiler will execute the statement in the if part.
Hence, the OUTPUT will be..
THE NUMBER IS SMALLER THAN THAN 20
17. INT KEYWORD –
int is one of the C keywords which we use for storing any integer value. C supports different types of data. Thus, int is also one of the four fundamental data types. int data type uses int keyword for storing any integer value in a variable.
Generally, int data type takes 2 bytes from the memory. Also, we can classify int data type into following..
- int or signed int – It takes 2 bytes from the memory and ranges from -32768 to +32767.
- unsigned int – It also takes 2 bytes from the memory and ranges from 0 to 65535.
- short int or signed short int – It takes 1 byte from the memory and ranges from -128 to 127.
- unsigned short int – It also takes 1 byte from the memory and ranges from 0 to 255.
- long int or signed long int – It takes 4 bytes from the memory and ranges from -2147483648 to 2147483647.
- unsigned long int – It also takes 4 bytes from the memory and ranges from 0 to 4294967295.
Here, int will be the keyword name and variable name will be of user’s choice.
In the above example, a is a variable of integer data type which store an integer value.
Also, in the other example num is an identifier of int data type. Also, num is having an integer value i.e. 10.