Saturday 30 September 2017

C language Paper Solution

NIELIT O Level
C Language Exam paper answer
January-2013

1. Multiple Choice

1.1 :  A
1.2 : C
1.3 : A
1.4 : B
1.5 : B
1.6 : C
Explanation :  When x will be less than 5 then continue transfer control at top of the loop and increase variable value,check condition. As soon as x get greater than 5 then if return false and control transfer to else . Else has break and when break will execute loop will be stop forcefully.

Thursday 28 September 2017

Metric Conversion with structure

Q :Define two structures Metric and British that store distances. The Metric stores values in meters and centimeters and the British stores values in feet and inches. Write a program that reads both structure variables and add values contained in one variable of Metric to the contents of another variable of British. The program should display the result in both: equivalent centimeters and equivalent inches.


Solution : 



For solve this question you need to know metric measurement unit.

1 centimeter = 10 millimeters
1 meter = 100 centimeters = 1,000 millimeters

Wednesday 27 September 2017

Array pass to function


Array is a collection of similar data type which occupies continuous location on memory. Array’s name is a constant pointer which point first element of array. So when an array is passing to a function. Address of first element pass to function instead of value. If any change made inside of function body with array, then it affects actual value of passed array. Following program demonstrate this fact.

#include<stdio.h>
int update(int[]);
void main()
{
     int arr[5],i;
     for(i=0;i<5;i++)

Monday 25 September 2017

Compilation Process c Language



Q : How Compilation, Linking and Loading are related? Also explain the basic task of a Compiler, Linker and Loader?

Solution : 


First of all we need to understand relationship between compilation, linker and linker form following compilation steps.

Compilation Process C Language


Step 1