Monday 30 January 2017

Traffic Light Programe

NIELIT O Level January 2016 Solved

Q 7 : c) Write a program that displays the recommended actions depending on the color of a traffic light using the switch statement.

Solution : 

/* *******************************************
     Girfa : Student Help
     Traffic Light Program
     for more program visit : http://girfahelp.blogspot.in/p/c-language.html
     ********************************************/

Saturday 28 January 2017

Difference between while and do while

NIELIT O Level January 2016 Solve paper

Q 7 b.(ii) while and do..while loops

Iteration statements allow the set of instructions to execute repeatedly till the condition doesn’t turn out false. The Iteration statements in C for while loop and do while loop. These statements are commonly called loops. Here, the main difference between a while loop and do while loop is that while loop check condition before iteration of the loop, whereas do-while loop, checks the condition after the execution of the statements inside the loop.

BASIS FOR COMPARISON
WHILE
DO-WHILE
Syntax
while ( condition) {
statements; //body of loop
}
do{
.
statements; // body of loop.
.
} while( Condition );
Controlling Condition
In 'while' loop the controlling condition appears at the start of the loop.
In 'do-while' loop the controlling condition appears at the end of the loop.
Iterations
The iterations do not occur if, the condition at the first iteration, appears false.
The iteration occurs at least once even if the condition is false at the first iteration.

Friday 27 January 2017

Passing array to function call by reference

NIELIT O Level January-16 

Q 7 (a) . How does passing an array as an argument to a function differ from call by value?

Solution : 


An array is a collection of similar data type which occupies continuous location on memory. Name of array is constant pointer which point (store address of first element of array) first element. When we passed an array to a function as an argument then we pass address of first element and if any change made inside of function to passing array then its effect original location because it is call by reference.
So when an array is passed to a function as an argument then it’s always being pass by reference.

Passing Array to function  C Language


Java Script Album With PHP

<html>
<head>
 <title>
Girfa :Student Help :: PHP Java Script Programming
</title>
 </head>
<body>
 <?php
echo 
"<script language='javascript'>";
echo 
"var i=0; show();";
echo 
"function show(){i++;if(i==5){i=0;}else{img1.src=i + '.jpg'";
echo 
"} setTimeout('show()',1000);}</script>";
?>
</body>
</html>