Program to to read and display data of students using an array of pointers

Output:

21_3

Program to to calculate distance b/w two heights passing structure as pointers to the function

21_2

Program to add and subtract two complex numbers using structures.

 

Output:

21_1

Program to read display add and subtract the two distances using structures

 

Output:

14_3

Passing members of structure student by using call by reference.

 

Output:

14_2

Program to read and display information of a student using structure within the structure.

 

Output:

14mar_1

Program to read and display information of a student using structure within the structure


14mar_1

 

Calling and Called function & Actual and formal parameters

Let us take an example:

 

Jump statements

-> Goto [Avoided in normal programming.]

-> Continue

-> Break

-> Return

 

Syntax are as follows:

-Goto:

Only statement2 will be executed and statement 1 won’t be executed as the programs makes a jump to label.

 

-Continue:

Example:

 

In this loop statement1 gets executed and statement2 will not be executed!

Continue statement after statement1 takes the control back to the decision making

i.e., foor loop here, and hence it skips the statement2 in each execution till n.

 

-Break:

Eg:

while(condition)

{

printf(“hi”);

break;

printf(“hello”)

}

 

This program prints hi and won’t print hello because before it moves to the

statement which prints hello break is encountered which beings the control out of the while loop and hence only hi is printed.

 

-Return:

return(value)

Eg:

main()

{

return(0)

}

It returns 0 to the main function.

 

 

 

Sentinel loops

In sentinel loops we don’t know that how many no. of times the loop will work!

That means that a sentinel loop can be regarded as infinite, indefinite loop.

For Eg:

 

Output will be an infinite loop printing “This is an infinite loop!” infinitely!! 🙂