Structure Initialization

Initialization: There are many methods to initialize the structure. Some of the following examples are: Compile time initialization: 1.      struct student { int roll_num; float percentage; } s1={1117,80.11}; In this …

Structure

Structure is a collection of heterogeneous elements. Heterogeneous means the elements may b differ in their data-type. Structure is very useful to make grouping of different type of data members. …

Category of functions

There are four main categories of the functions these are as follows: 1.      Function with no arguments and no return values. 2.      Function with no arguments and a return value. …

Function call

Function call: In function call there are following three parts: a.      Function name b.      Actual arguments c.       Semicolon Function name is must be same as we declared in our program …

Function declaration

Function declaration:  function declaration is must before call the function. And it divides into four parts as follows a.      Return-type b.      Function-name c.       Parameter d.       semicolon The above three parts …

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 …