Function definition

Function definition: function definition contains the statements which we want to perform some specific task according to requirement. Syntax:            return-type function-name(parameters) { Variable declaration; Statement1; ————— ————— Return statement; } …

Functions

Functions are very useful in the modern programming languages. There are many advantages of the functions. It divides the program to the sub-program which is very easy for code and …

String handling functions

String handling functions: 1.      strlen(): This function tells the number of character in a string. This will be as follows: l=strlen(string); where l is integer. 2.      strcat():  This function is …

Prints the string on screen

Printf(): we can print the string very easily using the printf() function using ‘%s’ as follows: Syntax:            printf(“%s”,variable); e.g:      printf(“%s”,str); putchar(): putchar() function is use to print the single …

String declaration and initialization

String declaration: There is no string data type in c. So string is declared as the array of characters. Syntax:            char variable-name[size]; e.g:      char S[10]; String initialization: like the integer …

Strings

A string is a collection of characters and consider as a single data item. The string example is as follows:       “Jalandhar” It is a string every string is inserted in …

goto statement

The goto statement is use to jump unconditionally from one statement to another in a program. There are two types of jumps one in forward jump and second is backward …

Conditional operator statement

Conditional operator statement: The conditional operator statement is used with the combination of ? and : and this is known as conditional operator.  Syntax:                         conditional expression ? expression1 : …

switch statement

Switch statement: The problem in if-statement is the complexity to read and follow. Even it may be confuse the programmer who designed it. The switch statement tests the value of …

if statement

if statement: The if statement is use to control the flow of the execution of statement. If the expression is true then it transfers the control to the particular statement. …