This download link is referred from the post: GTU BE/B.Tech 2019 Winter Question Papers || Gujarat Technological University
EnrolmentNo,
GUJARAT TECHNOLOGICAL UNIVERSITY
E - SEMESTER- I & II (NEW) EXAMINATION - WINTER 2019
--- Content provided by FirstRanker.com ---
Subject Code: 2110003 Date: 07/01/2020
Subject Name: Computer Programming And Utilization
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
- Question No. 1 is compulsory. Attempt any four out of remaining Six questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
--- Content provided by FirstRanker.com ---
Q.1 Objective Question (MCQ)
(a) 07
--- Content provided by FirstRanker.com ---
- In which of the following languages, the instructions are written in the form of 0s and 1s?
- Programming language
- Machine language
- Assemble language
- High-level language
- The statements between a function body are indicated by:
- {}
- ()
- \n
- /**/
- Which is a legal ‘C’ expression?
- a=[b+c];
- a={(b+c)};
- a=(b+c);
- a= {b*c};
- What will the output of following C code be?
# include <stdio.h>
int main()
{ int x=1,y=1,z; z=x++ +y; printf (“%d, %d”, x, y);
}--- Content provided by FirstRanker.com ---
- x=2, y=2
- x=2, y=1
- x=1, y=1
- x=1, y=2
- How many operands does the ‘conditional operator (?:) takes?
- Four
- Two
- One
- Three
- In which of the following the loop is executed at least once?
- while
- for
- do — while
- if
-
What will be the value of x[4]?int x[5]= {3,4,5}
- 0
- 4
- 5
- 3
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
(b) 07
- Which library function is used to compare two strings?
- strstr ()
- strchr ()
- strcmp ()
- strlen ()
--- Content provided by FirstRanker.com ---
- A function declaration consists of four parts. Which of them is wrongly mentioned?
- Terminating comma
- Function type
- Function name
- Parameter list
--- Content provided by FirstRanker.com ---
- Which of following operators is used to access the value of the variable using the pointer?
- *
- ->
- %
- &
--- Content provided by FirstRanker.com ---
- Which of the following determines the size of a union?
- Biggest member of the union
- First member of union
- Sum of the sizes of all members
- Which of the following functions is used to release allocated memory which is no longer required?
- dealloc ()
- dropmem ()
- free ()
- release ()
- Which of the following functions allocates request size of bytes and returns a pointer to the first byte of allocated space?
- calloc
- free
- realloc
- malloc
- Which of the following functions reads an integer from a file?
- fseek ()
- putw ()
- fscanf ()
- getw ()
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Q.2 (a) Write an algorithm to determine whether the given year is a leap year or not. 03
(b) What is a flow chart? How is it different from an algorithm? 04
(c) What is various types of operator available in C. 07
Q.3 (a) State the difference between entry control loop and exit control loop. 03
(b) What is difference between keywords and identifiers? Explain rules for naming an identifier. 04
--- Content provided by FirstRanker.com ---
(c) Write a program that reads a value n and generates the following pattern: 07
1
12
123
--- Content provided by FirstRanker.com ---
1234
12345
123456
1234567
12345678
--- Content provided by FirstRanker.com ---
123456789
Q.4 (a) Distinguish between the following pairs: 03
- getchar and scanf functions
- %s and %c specifications for reading.
- %s and %[ ] specifications for reading.
--- Content provided by FirstRanker.com ---
(b) Explain putchar() and puts() functions with suitable example. 04
(c) Write a program to copy one string into another and count the number of characters copied. 07
Q.5 (a) Compare for loop and while loop with illustrations. 03
(b) Describe following string functions in C — Language. 04
- strcpy( )
- strcat( )
- strlen( )
- strcmp ()
--- Content provided by FirstRanker.com ---
(c) What is recursion? Write C program to find factorial (N) using recursive Function? 07
Q.6 (a) State difference between call by reference and call by value. 03
--- Content provided by FirstRanker.com ---
(b) What is pointer? Explain Array of pointer with example. 04
(c) Write a function which accepts a string and returns the length of the string. 07
Q.7 (a) State difference between Union and Structure. 03
(b) Explain getw() and putw() function with example. 04
(c) What is file management? List the different file-management functions. 07
--- Content provided by FirstRanker.com ---
Explain the various file modes.
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE/B.Tech 2019 Winter Question Papers || Gujarat Technological University