Sie sind auf Seite 1von 4

Regulations:

Reg.No:

2011
7

BANNARI AMMAN INSTITUTE OF TECHNOLOGY


(An Autonomous Institution Affiliated to Anna University)

SATHYAMANGALAM 638 401

END SEMESTER THEORY EXAMINATIONS - NOV / DEC 2016


Semester
DEGREE & BRANCH :
B.E. & ECE
C PROGRAMMING
11L106
Time : 30 Min.

Maximum : 20 Marks

Instructions: (Kindly mention here any special instructions such as the Codes,
Data Books, Charts, Tables, Drawing and Graph Sheets to be
supplied or permitted.)
PART - A (20 x 1 = 20 Marks)
Answer All Questions
(Instructions to the Candidate : Write the appropriate answer in Page No.3 of your
Answer book)
1.

2.

3.

4.

5.

Which of the following is not a feature of compiler?


A) Scans the entire program first and then translate it into machine code
B) When all the syntax errors are removed execution takes place
C) slow for debugging
D) Execution time is more
_______ is named memory locations
A) Identifiers
B) Variable
C) Types
D) Mixed
____________ consists of one operand one operator. Operator precedes the
Operand
A) Prefix expression
B) Postfix expression
C) Unary expressions
D) Compound expression
When double is converted to float, the value is?
A) Truncated
B) Rounded
C) Depends on the compiler
D) Depends on the standard
The ___________ logical operator is true only when both the operands are true.
A) ||
B) &&
C) !
Page 1/4

6.

7.

8.

D) >>
The correct syntax for running two variable for loop simultaneously is.
A) for (i = 0; i < n; i++) for (j = 0; j < n; j += 5)
B) for (i = 0, j = 0;i < n, j < n; i++, j += 5)
C) for (i = 0; i < n;i++){} for (j = 0; j < n;j += 5){}
D) for (i = 0; i < 5;i++){} for (j = 0; j < n;j += 5){}
Which of the following cannot be checked in a switch-case statement?
A) Character
B) Integer
C) Float
D) All of the mentioned
Comment on the following statement:

int (*a)[7];
A) An array a of pointers.
B) A pointer a to an array.
C) A ragged array.
D) Array Pointers
9. Which of the following is not possible statically in C?
A) Jagged Array
B) Rectangular Array
C) Cuboidal Array
D) Multidimensional Array
10. What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>
union employee
{
char name[15];
int age;
float salary;
};
const union employee e1;
int main()
{
strcpy(e1.name, "K");
printf("%s %d %f", e1.name, e1.age, e1.salary);
return 0;
}

A) Error: RValue required


B) Error: cannot convert from 'const int *' to 'int *const'
C) Error: LValue required in strcpy
D) No error
11. To declare a 3 dimension array using pointers, which of the following is the correct
A) char *a[][];
B) char **a[];
C) char ***a;
D) All the above
Page 2/4

12.

13.

14.

15.

16.

17.

18.

19.

20.

Any C program
A) Must contain at least one function.
B) Need not contain any function.
C) Needs input data.
D) None of the above
The default parameter passing mechanism is
A) call by value
B) call by reference
C) Call by result
D) Change by value
In function free(p), p is a:
A) int
B) Pointer returned by malloc()
C) Pointer returned by calloc()
D) Both b & c
The function ____ obtains block of memory dynamically.
A) calloc
B) malloc
C) Both a & b
D) free
Which of the following cannot be a structure member?
A) Another structure
B) Function
C) Array
D) None of the mentioned
Memory allocation using malloc() is done in?
A) Static area
B) Stack area
C) Heap area
D) Both b & c
For binary files, a ___ must be appended to the mode string.
A) Nothing
B) b
C) binary
D) 01?
User-defined data type can be derived by___________.
A) struct
B) Enum
C) typedef
D) All the above
Which operator connects the structure name to its member name?
A) _
B) +
C) .
D) <Page 3/4

Time : 2 Hrs. 30 Min.

Maximum : 80 Marks

PART - B (10 x 2 = 20 Marks)


Answer All Questions
21. List out the five compilers for compiling C program
22. Differentiate between variable and types
23. Write a C program to find the given number is prime using if else statement.
24. Give the advantages of branching in C program.
25. Define string
26. Write a C program to copy a string without using string functions
27. Write a C program to get the input from the user using function with argument with
return types
28. List the advantages of array
29. Compare structure and unions
30. Give the syntax for file
PART - C (5 x 12 = 60 Marks)
31.a) Explain the procedure of compilation of C program with example
(OR)
31.b) Explain the operator precedence and associativity with examples

(12)

32.a) i)Write a C program to convert Binary number to Decimal Number

(12)

ii) Write a C program to list fibonacci series


(OR)
32.b) Is there any advantage of using recursion over looping control structures?

(12)

(12)

Give a suitable example.


33.a) Write a C program to sort numbers using selection sorting
(OR)
33.b) Write a C program for Matrix Multiplication

(12)

34.a) Write a program to perform swapping of two numbers using pointers.


(OR)
34.b) Summarize the various built-in String functions.

(12)

35.a) Write a program to generate the student marklist using Structure.


(OR)
35.b) Why are pointers so powerful? Analyze their efficiency giving an example?

(12 )

********************
Page 4/4

(12)

(12)

(12 )

Das könnte Ihnen auch gefallen