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

1) By default a real number is treated as a

A) float

B) double

C) long double

D) integer


A

In computing, 'real number' often refers to non-complex floating-point numbers.

It includes both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265... When the accuracy of the floating-point number is insufficient, we can use the double to define the number. The double is the same as float but with longer precision and takes double space (8 bytes) than float. To extend the precision further we can use a long double that occupies 10 bytes of memory space.

Show Answer


2) Which of the following expression is equivalent to ++*ptr?

A) (*ptr)++

B) ++*(ptr)

C) (ptr)*++

D) (ptr)++*


B

Show Answer


3) The default storage class of a ‘C’ variable is

A) auto

B) static

C) extern

D) register


A

Show Answer


4) 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

Show Answer


5) We can combine the following two statements into one using


    char *p;
    p = (char*) malloc(100);

A) char p = *malloc(100);

B) char *p = (char) malloc(100);

C) char *p = (char*)malloc(100);

D) char *p = (char *)(malloc*)(100);


C

Show Answer


6) How many times "DOEACC" will get printed?


     #include<stdio.h>
     int main()
     {
        int x;
        for(x=-1; x<=10; x++)
          {
            if(x < 5)
              continue;
            else
              break;
           printf("DOEACC");
           }
      return 0;
    }

A) Infinite times

B) 11 times

C) 0 times

D) 10 times


B

Show Answer


7) Which of the following statement is correct about the following program?

#include<stdio.h>
long fun(int num)
{
int i;
long f=1;
for(i=1; i<=num; i++)
f = f * i;
return f;
}

A) The function calculates the value of 1 raised to power num

B) The function calculates the square root of an integer

C) The function calculates the factorial value of an integer

D) None of the above


C

Show Answer


8) In C, if you pass an array as an argument to a function, what actually gets passed?

A) Value of elements in array

B) First element of the array

C) Base address of the array

D) Address of the last element of array


C

Show Answer


9) If a file is open 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


10) Which of the following functions is used to free the allocated memory?

A) remove(var-name);

B) free(var-name);

C) delete(var-name);

D) dalloc(var-name);


B

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)