July 5, 2021 in C and CPP
What is a structure?
c) What is a structure? How does a structure differ from a union? Give examples. For what
kind of applications, union data structure is useful? How are arrays different from
structure?
July 5, 2021 in C and CPP
c) What is a structure? How does a structure differ from a union? Give examples. For what
kind of applications, union data structure is useful? How are arrays different from
structure?
July 5, 2021 in C and CPP
b) A program in ‘C’ language contains the following declaration:
static int x[8] = {1,2,3,4,5,6,7,8};
i) What is the meaning of x?
ii) What is the meaning of (x + 2)?
iii) What is the meaning of *x?
iv) What is the meaning of (*x + 2)?
v) What is the meaning of *(x + 2)?
July 5, 2021 in C and CPP
a) What is a pointer in ‘C’? How is a pointer variable declared? Give examples and explain.
Enumerate the utility of pointer variables.
July 5, 2021 in C and CPP
c) Write a ‘C’ program that will enter a line of text, store in an array and then display
backwards. The length of the line should be undefined, (being terminated by ENTER
key), but less than 80 characters.
July 5, 2021 in C and CPP
b) What are subscripts? How are they specified? What restrictions apply to the values that
can be assigned to subscripts in ‘C’ language?
July 5, 2021 in C and CPP
a) Define an array. How are arrays processed in ‘C’? Illustrate by taking two-dimensional
arrays as examples.
July 5, 2021 in C and CPP
c) Identify all the compound statements which appear in the following program segment:
{
sum=0;
do {
scanf(“%d”, &i);
if (i < 0)
{
i=-i;
++flag;
}
sum += i;
} while (i != 0);
}
July 5, 2021 in C and CPP
a) Write and explain the action of WHILE statement. Develop a program in ‘C’ language to
compute the average of every third integer number lying between 1 and 100. Include
appropriate documentation.
b) Develop a function to calculate sum of n even integers starting from a given even
integer.
July 5, 2021 in C and CPP
c) It is said that ‘C’ is a middle level assembly language. Mention those features of ‘C’
which enable this description.
July 5, 2021 in C and CPP
b) What is an execution error? Differentiate it from syntactic error. Give examples.