Gujarat Technological University

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE- SEMESTER 1st / 2nd EXAMINATION (NEW SYLLABUS) – SUMMER - 2017

Subject Code: 2110003 Date:03/06/2017


Subject Name: Computer Programming & Utilization
Time: 2:30 PM to 05:00 PM Total Marks: 70
Instructions:
1. Question No. 1 is compulsory. Attempt any four out of remaining Six questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q.1 Objective Question (MCQ) Mark


(a) 07
1. In flowchart for what purpose ◊ symbol is
used?
(a) Processing.
(b) Condition.
(c) Data flow.
(d) input/output.
2. Continue statement
(a) Breaks loop and goes to next statement after
loop.
(b) Does not break loop but starts new iteration.
(c) Exits the program.
(d) Starts from beginning of program.
3. Which of the following loop is executed at least once
(a) for loop
(b) while loop
(c) do while loop
(d) None of the above
4. ASCII value of ‘a’ is
(a)97
(b)65
(c)47
(d) None of the above

5. A float requires ______bytes in memory


(a)2 bytes
(b)1 byte
(c)8 bytes
(d)4 bytes
6. The format string to accept a string is
(a)%c
(b)%d
(c)%f
(d)%s
7. Which header file is necessary for strlen() function?
(a)conio.h
(b)strings.h
(c)string.h
(d)stdio.h
(b)
07
1. When a key is pressed on keyboard, which standard is used for
converting the keystroke into the corresponding bits
(a) ANSI (b) ASCII
(c) EBCDIC (d) ISO
2. Which of the following is used as a string termination character?
(a) 0 (b) \0
(c) /0 (d) None of these
3. Which of the following operator is used to select a member of a
structure variable
(a) .(dot) (b) ,(comma)
(c) : (colon) (d) ;(semicolon)
4. C is a ___ language
(a) Machine Level (b) Low Level
(c) Middle Level (d)High Level
5. What is the output of the following code:
void main()
{
int i;
for(i=1;i<=10;i++);
printf(“%d\n”,i);
}
(a) 10 (b) 1 to 10
(c) 11 (d) None of the above
6. What is the output of the following code:
void main()
{
int i;
for(i=65;i<70;i++)
printf(“%c,”,i);
}
(a)65,66,67,68,69,70 (b)a,b,c,d,e,
(c)A,B,C,D,E, (d)A,B,C,D,E
7. What is the output of following code:
void main()
{
int i=5;
switch(i)
{
case 3: printf(“three”);
case 4: printf(“four”);
case 5: printf(“five”);
case 6: printf(“six”);break;
case 7: printf(“seven”);
default: printf(“default”);
}
}
(a)five (b)fivesixsevendefault
(c)fivesix (d) None of the above

Q.2 (a) List the data types provided by C programming language. 03


(b) What is bottom tested loop? Give example. 04
(c) Write a program to accept start number and end number from the 07
user and print all the numbers in the range.
Q.3 (a) Explain switch case in ‘C’ with the help of an example. 03

(b) Write code to find out largest of 2 numbers using ternary operator. 04
(c) Write a program in ‘C’ to print the following pattern 07
1
23
456
78910

Q.4 (a) Explain strcat(),strlen() and strcpy() functions with examples. 03


(b) Explain function declaration, function definition and function call. 04
(c) Write a function which takes 2 numbers as parameters and returns 07
the gcd of the 2 numbers. Call the function in main().

Q.5 (a) What is array? Give example of array. 03


(b) What is string? In how many ways can you accept data in a string? 04
(c) Write a program to accept a string and count the number of vowels 07
present in a string.

Q.6 (a) What is a pointer? How and when is it used? 03


(b) Write a function to swap 2 numbers. 04
(c) Write a program to find out the largest of an array. 07

Q.7 (a) What is a structure? Give example. 03


(b) Explain malloc(),calloc() with examples. 04
(c) Write a ‘C’ program to which copies the contents of one file to 07
other.
***********

You might also like