What is structured programming?

a) What is structured programming? Explain and give examples of relevant constructs
using pseudo-code. Highlight the advantages and disadvantages of structured
programming.

An external variable definition must not begin with storage class specifier

A. Macro B. One or zero C. Randomly
D. External E. Max F. True
G. String H. Automatic I. Extern
J. Register K. Dynamic L. SWITCH
M. Word Not Available N. EOF O. Arbitrary
P. typeDef
4.1 An external variable definition must not begin with storage class specifier ________.
4.2 A register variable is expected to be placed in the machine ________.
4.3 For ________ and static variables, initialisers must be constant expressions.
4.4 When a function calls itself, each invocation gets a fresh set of ________ variables,
independent of the previous invocation.
4.5 #define statement calls for simplest type of ________ substitution.
4.6 The function lseek provide a way to read or write a file in ________ order.
4.7 printf(“%.*s”, max, s) can be used to print at most ________ characters from a strings.
4.8 FILE is defined with a(n) ________ statement.
4.9 The process of allocating memory at run time is known as ________.
4.10 The function getchar( ) returns ________ when there is no more input character.

‘C’ programs are converted into machine language with the help of an interpreter.

Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.
2.1 ‘C’ programs are converted into machine language with the help of an interpreter.
2.2 Every ‘C’ program must contain a main( ).
2.3 Putchar( ) is used only for single character input.
2.4 calloc(…) allocates a block of memory for an array of elements of a certain size.
2.5 A printf( ) statement can generate only one line of output.
2.6 A switch expression can be of any data type.
2.7 ‘While’ is an entry as well as exit controlled loop statement.
2.8 ‘C’ treats character string simply as arrays of characters.
2.9 A function in ‘C’ should have at least one argument.
2.10 sprintf(…) writes data to the character array whereas printf(…) writes data to the
standard output device.

Regarding the scope of the variables; identify the incorrect statement

1.10 Regarding the scope of the variables; identify the incorrect statement:
A) automatic variables are automatically initialized to 0
B) static variables are automatically initialized to 0
C) the address of a register variable is not accessible
D) static variables cannot be initialized with any expression

Given the piece of code

1.9 Given the piece of code
int a[50];
int *pa;
pa=a;
To access the 6th element of the array which of the following is incorrect?
A) *(a+5)
B) a[5]
C) pa[5]
D) *(*pa + 5)

What does the following function print

1.8 What does the following function print?
func(int i)
{if(i%2) return 0;
else return 1;}
main( )
{
int=3;
i=func(i);
i=func(i);
printf(“%d”, i);
}
A) 3
B) 1
C) 0
D) 2