O Level | July 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)

1.1 Which of the following cannot be checked in a switch case statement?

A) Character

B) Integer

C) Float

D) enum


D

Show Answer


1.2 Which header file should be included to use functions like malloc() and calloc()?

A) memory.h

B) stdlib.h

C) string.h

D) dos.h


B

To allocate memory dynamically, library functions are malloc() , calloc() , realloc() and free() are used. These functions are defined in the <stdlib. h> header file.

Show Answer


1.3 For the program given below, which of the following statement is correct?
 

void main ( )
{
int i;
for(;scanf(“%d”.&i);printf(“%d”,i))
;
}

A) The for loop would not get executed at all.

B) The for loop would get executed only once.

C) The for loop would get executed 5 times.

D) The for loop would get executed infinite times.


D

Show Answer


1.4 In which order do the Relational, Arithmetic, Logical and Assignment operators get evaluated in C?

A) Arithmetic, Relational, Logical, Assignment

B) Relational, Logical, Arithmetic, Assignment

C) Logical, Relational, Arithmetic, Assignment

D) Assignment, Arithmetic, Relational, Logical


A

1 - Arithmetic operators: *, /, %, +, - 
2 - Relational operators: >, <, >=, <=, ==, !=
3 - Logical operators : !, &&, ||
4 - Assignment operators: =

Show Answer


1.5 By default a real number is treated as a

A) float

B) double

C) long double

D) integer


A

Show Answer


1.6 Which of the following function can be used to find the first occurrence of a given string in another string?

A) strchr( )

B) strrchr( )

C) strstr( )

D) strnset( )


C

The function strstr() Finds the first occurrence of a substring in another string
Declaration: char *strstr(const char *s1, const char *s2);

Return Value:
On success, strstr returns a pointer to the element in s1 where s2 begins (points to s2 in s1). On error (if s2 does not occur in s1), strstr returns null.

Show Answer


1.7 What will be the output of the following program?
 

void main( )
{
struct emp
{
char name[20];
int age;
float sal;
};
struct emp e ={“Tiger”};
printf(“\n%d %f”,e.age,e.sal);

A) 0 0.000000

B) Garbage values

C) Error

D) None of the above


B

Show Answer


1.8 If a file is opened in ‘write’ mode, then

A) If it does not exist, an error is returned

B) If it does not exist, it is created

C) If it exists, then data is written at the end

D) If it exists, error is returned


B

Show Answer


1.9 If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable.

A) ‘.’

B) ‘&’

C) ‘*’

D) ‘->’


D

Show Answer


1.10 The && and | | operators

A) compare two numeric values

B) combine two numeric values

C) compare two boolean values

D) None of the above


C

Show Answer


Exam Back Paper (Solved)


July 2013 | M4.3-R4 (Introduction to ICT Resources)


July 2013 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2013 | M2-R4 (Internet Technology and Web Design)


July 2013 | M1-R4 (IT Tools and Business Systems)


January 2013 | M4.3-R4 (Introduction to ICT Resources)


January 2013 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2013 | M2-R4 (Internet Technology and Web Design)


January 2013 | M1-R4 (IT Tools and Business Systems)


July 2012 | M4.3-R4 (Introduction to ICT Resources)


July 2012 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2012 | M2-R4 (Internet Technology and Web Design)


July 2012 | M1-R4 (IT Tools and Business Systems)


January 2012 | M4.3-R4 (Introduction to ICT Resources)


January 2012 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2012 | M2-R4 (Internet Technology and Web Design)


January 2012 | M1-R4 (IT Tools and Business Systems)


July 2011 | M4.3-R4 (Introduction to ICT Resources)


July 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2011 | M2-R4 (Internet Technology and Web Design)


July 2011 | M1-R4 (IT Tools and Business Systems)


January 2011 | M4.3-R4 (Introduction to ICT Resources)


January 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2011 | M2-R4 (Internet Technology and Web Design)


January 2011 | M1-R4 (IT Tools and Business Systems)


July 2010 | M4.3-R4 (Introduction to ICT Resources)


July 2010 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2010 | M2-R4 (Internet Technology and Web Design)


July 2010 | M1-R4 (IT Tools and Business Systems)