0% found this document useful (0 votes)
78 views44 pages

C Programming-Question Bank

The document is a question bank for a Programming in C and Data Structures course for the academic year 2016-17. It includes various programming questions categorized into parts and modules, covering topics such as pseudo-code, data types, control structures, functions, arrays, structures, file handling, and pointers. Each question specifies marks and requires students to demonstrate their understanding of C programming concepts through coding and explanations.

Uploaded by

shravan18k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views44 pages

C Programming-Question Bank

The document is a question bank for a Programming in C and Data Structures course for the academic year 2016-17. It includes various programming questions categorized into parts and modules, covering topics such as pseudo-code, data types, control structures, functions, arrays, structures, file handling, and pointers. Each question specifies marks and requires students to demonstrate their understanding of C programming concepts through coding and explanations.

Uploaded by

shravan18k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Computer Concept and C Programming 2016-17

QUESTION BANK
Subject/ Subject Code: Programming in ‘C’ and Data Structure (15PCD14)
Academic Year / Semester: 2016-17, 1st Semester

Programming in C and Data Structures


June.2016 – July.2016

PART-A
1.
a. What is pseudo-code? Compare it with an algorithm. (05 Marks)
b. Convert the following into ‘C’ expression:
𝑍
i) 𝑋𝑌 ii) 𝑒√𝑋 iii) 𝑎. 𝑏
√𝑐. 𝑑
iv) √𝑠(𝑠 − 𝑎)(𝑠 − 𝑏)(𝑠 − 𝑐) (04 Marks)
c. Write a C program to find largest among three integer using ternary
operators. (06 Marks)
a. Explain formatted input and output statements with examples.
(05 Marks)

2.
a) Write a structure of C program. List primitive data types with size and
range (10 Marks)
b) Define type casting .explain with an example (04 Marks)
c) Evaluate following (where i=2,j=3,k=4 and a=5):
i) a=i*(j/=k/i) ii)a>>i%j iii)i*a/i%i. (06 Marks)

PART-B
3.
a) Write a C program to grade students result based on following conditions:
i) Marks<35 grade “fail”
ii) 35≥Marks<60 grade “second class”
iii) 60≥Marks<70 grade “first class”
Iv) 70≥Marks≤100 grade “first class with distinction”. (08 Marks)
b) Explain switch statement with an example (07 Marks)

1
Computer Concept and C Programming 2016-17

c) Write a note on goto statement (05 Marks)

4.
a) Explain cascade if-else and nested if-else statements. (06 Marks)
b) Write a C program to implement simple calculator using
operators +,-,*and /.also handle divide by zero error. Use switch statement.
(10 Marks)
c) What is dangling else problem? Explain how to handle this in C
programming (04 Marks)

PART-C
5.
a) Define array? How two dimension arrays are declared and initialized?
(06 Marks)
b) Write a C program to generate Fibonacci numbers using arrays (06 Marks)
c) Explain following string functions: i)strlen ii)strcpy iii)strcmp iv)strcat
(08 Marks)
6.
a) Explain various ways of passing parameters to the functions (06 Marks)
b) Write a C program to find factorial of an integer using recursive function
(08 Marks)
c) Write a C program to find length of a string without using strlcn() function
(06 Marks)

PART-D
7.
a) Compare array with structures (06 Marks)
b) Define structur.Explain it with an example (05 marks)
c) Explain the following:
I. Typedef to define structure
II. Accessing structure members
III. Initialization of a structure (09 Marks)

8.
a) Explain the following file handling functions:
i) Fopen() ii) fclose() iii) fscanf() iv) fprintf() v) fseek()
(10 marks)
b) Write a C program to create a integer data file and then segregate odd and
even integers into two different files .
(10 marks)

PART-E

2
Computer Concept and C Programming 2016-17

9.
c) What is pointer? explain with program (06 Marks)
d) Explain the following:
i) #define ii) #include iii) nesting of macro iv) argumented
macro
(10 Marks)
d) Explain malloc and calloc functions
(04 Marks)

Dec.2015 – Jan.2016

Module -1
1.
a. What is variable? Explain the rules for constructing variables in C language?
Give examples for valid and invalid variables. (6 marks)

b. Evaluate the following expressions:


i) 100%20 <=20-5+100%10-20==5>=1!=20
ii)a+=b*=c-=5 where a=3 b=5 and c=8. (4 marks)

c. Write a C program to find the area and perimeter of a rectangle. (6 marks)

OR
2.
a. Write a C program which takes as input p, t, r. Compute the simple interest
and display the result. (6 marks)

b. Convert the following mathematical expression into C expressions:


i) x/b+c + y/b-c ii) a + b(ad+e)/b-a – c/d.
(4marks)
c. What is value fo “x” in following code segments? Justify your answers:
i) int a, b; ii) int a, b ;
float x; float x;
a=4; a=4;
b=5; b=5;
x=b/a; x= (float) b/a; (6 marks)

Module -2

3.

3
Computer Concept and C Programming 2016-17

a. Explain the syntax of do-while statement. Write a C program to find the


factorial of a number using do-while, where the number n is entered by user.
(8 marks)
b. What is two way selection statement? Explain if, if –else, and cascaded if- else
with examples. (8 marks)

OR
4.
a. Write a C program that takes from user an arithmetic operator(‘+’, ‘-‘ , ’ * ’ or
‘/ ’ ) and two operands . Perform the corresponding arithmetic operation on
the operands using switch statement. (8 marks)

b. What is an array? How to declare and initialize the two dimensional array?
(8 marks)

Module -3

5.
a. What is a function? Write a C program to find the cube of a number using
function. (5 marks)

b. Write a C program to check a number is a prime or not using recursion.


(5 marks)
c. Write a program to replace each constant in a string with the next one except
lette ‘z’ ‘Z’ and ‘a’, ‘A’. Thus the string “programming in C is fun” should be
modified as “Qsphsannjoh jo D jt gvo”. (6 marks)
OR

6.
a. Write a C program to sort the elements by passing array as function argument.
(8 marks)

b. Write a C program to concatenate two strings without using built – in function


strcat(). (8 marks)

Module -4

7.
a. What is structure? Explain the C syntax of structure declaration with example.
(5 marks)

b. Write a C program to pass structure variable as function argument.


(7 marks)

c. Explain fopen() and fclose() functions. (4 marks)

4
Computer Concept and C Programming 2016-17

OR
8.
a. Write a C program to store and print name, USN, subject and IA marks of
students using structure. (8 marks)

b. Explain fputc(), fputs(),fgetc() and fgets() functions with syntax. (8 marks)

Module -5

9.
a. What is a pointer? Write a C program to find the sum and mean of all elements
in an array using pointer. (8 marks)

b. What is stack? Explain its operations with examples. (8 marks)

OR

10.
a. Write a C program to swap two numbers using call by address. (6 marks)

b. Explain any five preprocessor directives in C. (5 marks)

c. What are primitive and non-primitive data types? Explain with examples.
(5 marks)

Programming in C and Data Structures


Dec.2014 – Jan.2015

1.

5
Computer Concept and C Programming 2016-17

a. What is pseudocode? Explain with an Example.


(4 marks)
b. Explain the structure of C program with an example.
(6 marks)
c. Explain any 5 operators used in C language.
(10 marks)
2.

a. What is type conversion? Explain two types of type conversions with


examples.
(6 marks)
b. Write a program in C to find the area and perimeter of a triangle.
(6 marks)
c. Define : i) Variable ii) Constant iii)Associativity iv) Precedence
(8 marks)
3.

a. What is two way selection statement? Explain if, if-else, nested if-else and
cascaded if-else with examples and syntax.
(10 marks)
b. Write a program that takes three coefficiants (a, b, and c) of quadratic
equation: (ax2+bx+c) as input and compute all ossible roots and print them
with appropriate message.
(10 marks)
4.
a. Explain switch statement with an example.
(6 marks)
b. What is loop? Explain the different loops in C language.
(10 marks)
c. Show how break and continue statement are used in a C program, with
example.
(4 marks)
5.
a. What is an array? How single dimensional array is is declared and initialized?
(6 marks)
b. Write a C program to evaluate the polynomial f(x) =a4x2+a3x3+a2x2+a1x+a0, for
a given value of x and its coefficients using Horner’s method.
(6 marks)
c. Explain string manipulation functions, with examples.
(8 marks)
6.

a. What is a function? Write a function to find the sum of two numbers.


(6 marks)
b. Explain the two categories of argument passing techniques, with examples.
(6 marks)

6
Computer Concept and C Programming 2016-17

c. Write a C function isprime(num) that accepts an integer argument andreturns


1 if the argument is prime or 0 otherwise. Write a program to that invokes this
function to generate prime number between the given ranges.
(8 marks)
7.
a. What is structure data type? Explain.
(4 marks)
b. Show how structure variables are passed as a parameter to a function, with
an example.
(6 marks)
c. Explain the concept of array of structures, with a suitable C program.
(10 marks)
8.
a. What is a file? Explain fopen(), fclose() function.
(4 marks)
b. Explain how the input is accepted from the file and displayed.
(6 marks)
c. Given two text documentary files “Ramayana.in” and “Mahabaratha.in”. Write
a C program to create a new file “Karnataka.in: that append the content of the
file “Ramayana.in to the file “Mahabharatha.in”. Also calculate the number of
wordsand new lines in the output file.

(10 marks)
9.
a. What is pointer? Write a program in C to find the sum and mean of all elements
in an array. Use pointer technology.
(8 marks)
b. What is preprocessor directive? Explain #define and #include preprocessor
directives.
(8 marks)
c. Explain:
i) Dynamic memory allocation.
ii) Malloc function.
(4 marks)

10.
a. What is a primitive and non primitive data type? Explain.
(6 marks)
b. Define queue. Explain it along with its application.
(8 marks)
c. Explain.
i) Abstract data-type.
ii) Stack

7
Computer Concept and C Programming 2016-17

iii) Linked list.


(6 mar

Model Question Paper PROGRAMMING IN C


AND DATA STRUCTURES (15PCD13/15PCD23)

Time: 3 hrs. Max. Marks: 100

Note: Answer any FIVE full questions, choosing one full question from each
module.

MODULE 1

1) a. What is pseudo code? How it is used as a problem-solving tool. (6 Marks)

b. What is an operator? Explain the arithmetic, relational, logical, and (10 Marks)
assignment operators in C language.

c. Write a program in C to print the numbers from 4 to 9 and their (4 Marks)


squares.
OR

2) a. Write and explain the basic concepts of a C program. (8 Marks)

b. Write the guidelines to use printf() function in C language. (8 Marks)

c. Write a program in C to find the area and perimeter of a circle. (4 Marks)

MODULE 2

3) a. Explain the two way selection (if, if-else, nested if-else, cascaded if- (8 Marks)
else) in C language with syntax .
b. Explain the switch statement with syntax and example. (8 Marks)

c. Design and develop a C program to read a year as an input and find (4 Marks)
whether it is leap year or not. Also consider end of the centuries.
OR

4) a. Explain the different types of loops in C with syntax and example. (8 Marks)

8
Computer Concept and C Programming 2016-17

b. Explain the use of break and continue statement in loops with example. (6 Marks)

c. Design and develop a C program to reverse of an integer number NUM (6 Marks)


and check whether it is PALINDROME or NOT.

MODULE 3

5) a. What is an array? Explain the declaration and initialization of one (6 Marks)


and two dimensional arrays with example.
b. Explain void and parameter less functions in C with examples. (6 Marks)

c. Write a C program that: (8 Marks)


i. Implements string copy operation STRCOPY(str1,str2) that copies
a string str1 to another string str2 without usinglibrary
function.
ii. Reads a sentence and prints frequency of each of the vowels and
total count of consonants.

OR

6) a. Explain any five string manipulation library functions with examples. (10 Marks)

b. What is function parameter? Explain different types of parameters in (4 Marks)


C functions.

c. Write a C function isprime(num) that accepts an integer argument and (6 Marks)


returns 1 if the argument is prime, a 0 otherwise. Write a C program
that invokes this function to generate prime numbers between the
given ranges.

MODULE 4

7) a. What is a structure? Explain the syntax of structure declaration with (4 Marks)


example.

b. What is a file? Explain how the file open and file close functions (6 Marks)

handled in C.

9
Computer Concept and C Programming 2016-17

c. Write a C program to maintain a record of “n” student details usingan (10 Marks)
array of structures with four fields (Roll number, Name, Marks, and
Grade). Each field is of an appropriate data type. Print the marks of the
student given student name as input.

OR

8) a. Explain array of structures and structure within a structure with (8 Marks)


examples.

b. Explain how the structure variable passed as a parameter to a (6 Marks)


function with example.

c. Write a C program to read and display a text from the file. (6 Marks)

MODULE 5

9) a. What is a pointer? Explain how the pointer variable declared and (4 Marks)
initialized.

b. What is dynamic memory allocation? Write and explain the different (6 Marks)
dynamic memory allocation functions in C.
c. What are primitive and non-primitive data types? (4 Marks)

d. Write a C program to swap two numbers using call by pointers method. (6 Marks)

OR

10) a. Explain the array of pointers with example. (4 Marks)

b. Write and explain any two preprocessor directives in C. (4 Marks)

c. What is a stack? Explain it with its applications. (4 Marks)

d. Write a C program to read n unsorted numbers to an array of size n (8 Marks)


and pass the address of this array to a function to sort the numbers
in ascending order using bubble sort technique.

10
Computer Concepts and C Programming 2016-17

Computer Concepts and C Programming


Examination, December 2011
Note: 1. Answer any FIVE full questions, choosing at least two from each part.
2. Answer all objective type questions only on OMR Sheet page 5 of the
answer booklet.
3. Answer to objective type questions on sheets other than OMR will not be
valued.
1. a. Select the correct answer: (04 Marks)
i) The general name given to the physical parts of a computer is
A) Software B) Hardware C) Firmware D) Computer ware
ii) A byte contains number of bits.
A) 12 B) 8 C) 16 D) 32
iii)Which of these is not an example of software?
A) Utilities B) Operating System
C) Floppy Disk C) Device Driver
iv) Which of these is not a part of information processing cycle and explain them?
A) Data Sharing B) Data Collection
C) Data Storage D) Data Output

b. Mention the various steps associated with the information processing


cycle and explain them. (08 Marks)

c. What is a data scanning device? Mention any four such devices.


(04 Marks)
d. i) Convert the binary number 1 1 1 0 0 1 1 1 to decimal number.

ii) Convert the decimal number 55 to binary number.


(04 Marks)

2. a. Select the correct answer:


(04 Marks)
i) A translator which reads a high level program line by line and converts its into
machine language code
A) Translator B) Interpreter C) Compiler D) Assembler
ii) The size of most commonly used floppy these days is
A) 8 inch B) 3.5 inch C) 5.25 inch D) 2.5 inch
iii)Which of these is not a network topology?
A) Bus B) Ring C) Star D) Squar
iv) Which of these is not a type of translator
A) Assembler B) Interpreter C) Compiler D) Integrator

11
Computer Concepts and C Programming 2016-17

b. Mention the various functions of an operating system. Explain any two of them.
(08 Marks)
c. List and explain the basic components of a computer network.
(04 Marks)
d. Mention the different storage devices and explain one of them.
(04 Marks)

3. a. Select the correct answer:


(04 Marks)
i) Which of the following is associated with software changes / modification /
evaluation of software?
A) Design B) Coding C) Testing D) Maitenance
ii) The type of programming that is done using C is
A) High level B) Low level
C) Both A & B D) Non of these
iii) The function which takes a single character input from the keyboard is

A) get chr B) get char C) give char D) char get


iv) Which of these is not a key word to C language?
A) float B) static C) delete D) insert
b. What are C tokens? Mention them. Explain any two of them.
(08 Marks)
c. What is a data type? Mention the basic data types available in C.
(04 Marks)
d. What are variables? How are they declared?
(04 Marks)

4. a. Select the correct answer:


(04 Marks)
i) The order in which different operations in an expression are evaluated is
decided by
A) Associativity B) Precedence C) Evaluation D) Format
ii) The correct version of the clause to include I/O function library in C program
is
A) #include<io.h> B) #include<std io.h>
C) include #<io.h> D) include #<std io.h>
iii)The result of evaluating the expression 7 % 5 +10.0 * 10/3 is
A) 32.0 B) 32 C) 31.0 D) 31
iv) Let K=12, i=3, J=5. Consider the statement K+=i+J++; After execution the
values of k, I, J respectively are
A) 21, 3, 6 B) 20, 3, 6 C) 21, 3, 6 D) 20, 4, 6
b. Explain the structure of C Program.
(06 Marks)

12
Computer Concepts and C Programming 2016-17

c. Write a program to find the area of a triangle given the three sides.
(06 Marks)
d. With examples, illustrate any four common programming errors.
(04 Marks)

5. a. Select the correct answer:


(04 Marks)
i) Which of the following will not be terminated by semicolon sign?

A) Function prototype B) Function calling statement


C) Function Definition D) None of these
ii) A function that calls itself is
A) Nested function B) Overloaded function
C) Recursive function D) Inline function
iii) The scope of the variables defined in a function is
A) Local B) Modular C) Global D) Universal
iv) The parameters used in a function call are called parameters.
A) Formal B) Dummy C) Actual D) None of these
b. Mention the different ways of passing parameters to the function. Explain
one of them.
(08 Marks)
c. Write a program to accept two integers and swap their values using a
function to swap. (08 Marks)

6. a. Select the correct answer:


(04 Marks)
i) The correct statement for checking a condition in if statement is

A) if(a=b) B) if(a==b) C) if(a,b) D) if(ab)


ii) The loop in which the number of iterations remain known prior to the
execution of the loop is
A) for B) While C) do while D) None of these

iii) The value of switch expression must be of type _


A) Real B) int C) double D) All of these

iv) The least number of times the do-while loop will be executed is _
A) 0 B) 1 C) 2 D) Both A & B

b. Distinguish between while and do-while statement. (08 Marks)


c. Write a C program to read a positive number and reverse the given
number. (08 Marks)

7. a. Select the correct answer: (04 Marks)


i) Number of elements in an array defined by a[3][4] is
A) 8 B) 12 C) 16 D) None of these
ii) If x[4] is a declaration, then the first and last array index will be
13
Computer Concepts and C Programming 2016-17

A) 1,4 B) 0,3 C) 3,0 D) None of these


iii)Given int a[3][2] = {1,2,3,4,5,6:; the element in the 3rd row and 2nd column is

A) 3 B) 6 C) 52 D) 4
iv) A function that is used to join two strings is
A) Strepy B) Strlen C) Streat D) Stremp

b. Explain the declaration and initialization of one dimensional array with


examples. (06 Marks)

c. Write a C program to input N integers into a single dimensional array


and sort them in descending order using bubble sort method. Print both
given array and sorted array with suitable headings. (10 Marks)

8. A. Select the correct answer: (04 Marks)


i) _ execution of instructions in a computer system is referred to as
parallel computing.
A) Serial B) Sequential C) Accurate D) Simultaneous
ii) Which of the following can be used as a resource in parallel programming?
A) A single computer with multiple processors.
B) An arbitrary number of computers connected by a network
C) A combination of the above.
D) None of these.
iii) Open MP stands for
A) Open multi-parallelism B) Organised multi-programming
C) Open multi-processing D) Organised multi-parallelism
iv) An example of environment variable in OPEN MP is
A) Open – thread - limit B) Omp-init-lock
C) Omp-test-lock D) Omp-get-dynamic

b. Define concurrent processing. What is the motivation for concurrent processing?


(10 Marks)

c. What are threads? Give the advantages and disadvantages of multiple threads.
(06 Marks)

*******

Computer Concepts and C Programming

14
Computer Concepts and C Programming 2016-17

Examination, January 2011


Note: 1. Answer any FIVE full questions, Choosing at least two from each
part.
4. Answer all objective type questions only on OMR Sheet page 5 of the
answer booklet.
5. Answer to objective type questions on sheets other than OMR will not be
valued.
Part-A
1. a. Choose your answers for the following: (4 Marks)
i. Which of these are also know as PDA s?
a. Workstations b. Mainframes
c. Handheld PC d. Super Computer
ii. Which is the most powerful type of computers?
a. Microcomputers b. Minicomputer
c. Mainframe computer d. Super computer
iii. Which of the software is used for creating slide show?
a. Web design software c. Word Processing Software
b. Presentation Software d. Spread Sheet Software
iv. Which of the following is not a type of mouse?
a. Infra-red mouse c. Opto-mechnical mouse
b. Optical mouse d. Wireless mouse
b. Draw the basic structure of computer and explain in brief. (6 Marks)
c. Explain the different types of printers. (10 Marks)
2a. Choose your answers for the following: (4 Marks)
i. The two types of storage available in host computer system are
and
a. Primary and Secondary b. RAM and ROM
c. Primary and hard disk d. None of these
ii. An example of magnetic storage device is
a. CD-ROM b. Diskette c.DVD d. Flash memory
iii. What does the term SCSI stand for?

15
Computer Concepts and C Programming 2016-17

a. Small computer software interface c. Small computer storage interface


b. Small computer system interface d. Small computer standard interface
iv. Acronym DOS stands for
a. Disk operating system b. Driver operating System
c. Diskless operating system d. Distributed operating system
b. List and explain any four types of computer processing techniques (10Marks)
c. Explain the types of networks, in brief. (6 Marks)
3 a. Choose your answers for the following: (4 Marks)
i. Which of the following is not a data type?
a. char b.float c. int d. logical
ii. Symbols used in flow chart for decision making is:
a. rectangle b. circle c. parallelogram d. diamond shape
iii. The tool used to convert a source program to a machine language is:
a. Compiler b. Loader c. Linker d. Preprocessor
iv. Which of the following is not a valid identifier?
a. _option b. amount c. $amount d. sales_amount
4 a. Choose your answers for the following: (4 Marks)
i. Which of the following is a unary expression?
a. ++X b.- - X c. - 5 d. x=4
ii. is used to determine the order in which different operations in
complex expression are evaluated
a. Predictivity b. infix evaluation c. associativity d. None of these
iii.How will a=(int)32.2/(int)4.3 be evaluated?
a. 32.3/4.3 b. 32.0/4.0 c. 32/4 d. none of these
iv.Which is not an arithmetic operator?
a.+ b. – c. * d. &
b. Write C assignment statements for : (6 Marks)
i). Area=πr2+2 πrh ii). Torque=(2m1m2/m1+m2)*g iii). Side=√a2+ b2-2ab cos(x)
c. Write C program to convert degree to radians accepting a value from user.
(6 Marks)
d. Explain the postfix and prefix expressions, with example. (4 Marks)

16
Computer Concepts and C Programming 2016-17

PART-B

5 a. Choose your answers for the following: (04 Marks)

i) The default return type of a function is:

A) void B) char C) int D) float

ii) A variable declared in a function is called

A) actual variable B) local variable C) formal variable D) global variable

iii) The main ( ) is a

A) library function B) keyword C) user defined function D) none of these

iv) Which of the following is not a part of function header?

A) name B) parameter list C) return type D) title

b. Discuss the different methods of parameter passing to function, with examples.


(10 Marks)
c. Write a C — program to find GCD of two numbers. (06 Marks)

6 a. Choose your answers for the following: (04 Marks)


i) is a way to implement a multiway selection in C.
A) while do B) goto
C) for D) switch case
ii) Which of the following is not a comparator operator in C?
A) < B) <= C) = D) >=
iii) Which of the C — loops is not a pretest loop?
A) do while B) for
C) while ` D) none of these

iv) Given the while loop as:


i=1;
while (i<32)
{
print f (“%d”, i);
y;
}
If the loop must produce an o/p of 1, 2, 4, 8, 16, 32, which of the following
must replace y?
A) i = j + 2 B) i = i/2 C) i= i x 2 D) none of these

17
Computer Concepts and C Programming 2016-17

b. List the different decision making statements. Explain any two with their syntax
and example. (07 Marks)
c. Write the C-code to find factorial of a number with all the looping statements.
(06 Marks)
d. Explain the use of break and continue statements. (03 Marks)

7 a. Choose your answers for the following: (4 Marks)


i) If x [5] is a declaration, then the first and last array index will be:

A) 1, 5 B) 1, 6 C) 0, 4 D) 0, 5
ii) An array is a group of related data that shares a common
A) name B) index C) values D) all of these

iii) Which of the following statement assigns the value stored in x to the first
element on an array, ary?
A)ary=x[1]; B)ary=x[0]; C)ary[0]=x; D)ary[1]=x;
iv) The de-limiter in a C string is:
A) new line B) a del character C) a null character D) none of these
b. Explain the declaration and initialization of one-dimensional array, with an
example. (06 Marks)
c. Explain the initialization and declaration of C — strings. (04 Marks)
d. Write a C program to read an array of size ‘N’ and print the array elements.
(06 Marks)
8 a. Choose your answers for the following: (04 Marks)
i) Parallel computing is execution of instructions in a computer.
A) simultaneous B) serial C) accurate D) complete
ii) Which of the following is not a synchronization construct?
A) single B) master C) section D) critical
ii) reduces multiple
private copies of variables
belonging to different
threads into a single value.

A) reduction B) consolidate C) deduction D) merge


iii) Which of the following open Mp environmental variables enables or
disables Nested parallelism?
A) omp_set_nested B) omp_get_nested C) omp_nested D) none of these
b. What is a thread? What are the advantages of using threads? (06 Marks)
C. Explain the open Mp programming model, with a sample program.
(10 Marks)

QUESTION BANK

18
Computer Concepts and C Programming 2016-17

UNIT-I
CHAPTER 1: INTRODUCTION TO COMPUTER SYSTEM, INTERACTING
WITH THE COMPUTER, COMPUTER ORGANIZATION
2. a. Choose the correct answers for the following : (04 )( June/July 2013)
i) The term dots per inch (dpi) refers to printer’s _ .
A) Resolution B) speed c) output D) colours
ii) is used to identify product and provide information such as
price.
a) Price checkb) Barcode reader c)Numeric digit
d) Light sensitive detector
iii) is not a computer language.
a) Assembly language b)High level language.
C) Natural language d) Machine level language
iv) Which operating system first appeared with IBM PC?

A) Windows b) Linux c) Mac OS D) DOS

3. Briefly explain about the various generations of computers.


6M( (dec 2013)

4. With a neat figure, explain how instructions are processed by the CPU.
5M( (dec 2013)
5. Describe briefly about the various keys present on a standard keyboard.
5M( (dec 2013)
6. What is information processing cycle? Explain four steps with flow chart.
(04) (June/July 2013)

7. With a neat diagram, explain functions of each units of basic model of computer.
(06) (June/July 2013)
8. Convert the following: (06) (June/July 2013)
i) (10101)2 = ( ? ) 10 = ( ? ) 16 ii) (50) 8 = ( ? ) 10 = ( ? ) 2

9. Choose the correct answer: (04)(Jan2013)


i) Which of the following is not an input device.
(A) Plotter (B) Scanner (C) Keyboard (D) Mouse
ii) Conversion of single program to M/C language is done
(A) Linker (B) Compiler (C) Editor (D) OS

19
Computer Concepts and C Programming 2016-17

iii) Computer is controlled by _


(A) Hardware (B) Software (C) Instructions (D) Statement
iv) Computer converts data into
(A) Information (B) Charts (C) I/P, O/P (D) Software

10. Identify and categorize the basic component of a computer, with a neat diangram.
11. How would you describe basic structures of a computer.

12. Explain the basic structures of a computer, with a neat diangram.


(06) (Ja2013)
13. Explain the following input devies: i) Pen based input device ii) Optical input
devices (06)(Jan2013)
14. How would you Explain information processing cycle.
15. Explain information processing cycle. (04) (Jan 2013)
16. What is a computer? What are the various task of computer?
17. describe various features of a computer?
18. Differentiate between digital and analog computers.
19. Explain briefly the various generation of computer. (06) (Aug/2006)
20. Differentiate between floppy disk and hard disk. ? (06) (Aug/2003)
21. What do you mean by secondary storage? Bring out secondary storage devices?
(08)(Aug/2003)
22. Describe the computers for individual users? (06)(Dec 08/Jan 09)
23. Explain the features of computers available for individuals and organizations.
(10) (July 2007)
24. How would you classify the computer for organization?

25. What is an information processing cycle? Explain it in detail.


(05) (Dec 08/Jan09)
26. Explain the Von-Neumann architecture with the help of diagram.
(04)(Jan/Feb 2003)
27. What are the essential computer hardware units?
(10) (Jan 07, Aug 05, Feb 04, Aug 03)
28. What are the basic structural units of computer?

20
Computer Concepts and C Programming 2016-17

(06) (Jan 07, Aug 05, Feb 04, Aug


03)
29. Differentiate between RAM and ROM? (04) (Dec/Jan 2006)
30. Differentiate between System software and application software?
31. How would you compare different keys in standard keyboard. ?
32. Can you identify the different types of keyboard technologies?
33. What is a Mouse? Explain the different types of mouse devices?
34. Explain briefly working of keyboard and mouse devices?
35. Discuss the operation of the following devices.
a) Pen b) Game Controller c) data scanning devices
36. What are Monitors? Explain the various types of monitors.
37. Explain the characteristics of monitors?
38. Explain the different types of monitor cable technologies?
39. Discuss the construction and operation of CRT monitor? (08) (Aug/2007)
40. Explain different key board and mouse connectors?
41. Classify the following printers into impact /non impact types
i)Dot matrix ii) Laser jet iii) inkjet (10)(Feb/Mar 2005)
42. Explain the Dot Matrix and Laser printers. (06) July/Aug 2003)
43. What are the differences between Dot Matrix and Laser printers?
44. Mention the different types of printers along with main features of each type.
(05) (July/Aug 2004)
45. a. Choose the correct answers for the following : (04 )( June/July 2013)
v) The term dots per inch (dpi) refers to printer’s .
B) Resolution B) speed c) output D) colours
vi) is used to identify product and provide information such as
price.
b) Price checkb) Barcode reader c)Numeric digit
d) Light sensitive detector
vii) is not a computer language.
b) Assembly language b)High level language.
C) Natural language d) Machine level language
viii) Which operating system first appeared with IBM PC?

A) Windows b) Linux c) Mac OS D) DOS

21
Computer Concepts and C Programming 2016-17

b. What is information processing cycle? Explain four steps with flow chart.
(04) (June/July 2013)
c. With a neat diagram, explain functions of each units of basic model of
computer. (06) (June/July 2013)
d. Convert the following: (06) (June/July 2013)
i) (10101)2 = ( ? ) 10 = ( ? ) 16 ii) (50) 8 = ( ? ) 10 = ( ? ) 2

UNIT-II
CHAPTER 2: STORAGE DEVICE CONCEPTS, OPERATING SYSTEM,
NETWORKING
1. a. Choose the correct answers for the following :(04 Marks) ( June/July 2013)
i) _ is two or more LAN’s connected together across large
geographical area.
a) GAN b) LAN c) WAN d) MLAN
ii) Temporary storage in main memory is called as .
a) Buffer b) Secondary Memory

c) Tirtary memory d) None of these


iii) Which of the following unit represents largest amount of data?
a) Kilobyte b) Terabyte c) Gigabyte d) Megabyte
iv) Identification number of every computer connected to internet is
.
a) Sub net mask b) Gate way c) MAC address d) IP address

1. Explain in detail about the construction and operation of the hard disk drive.
5M( (dec 2013)

2. Briefly write about various computer processing techniques to process data.


7M( (dec 2013)
3. List the different network components with examples.
4M ( (dec 2013)

4. Explain basic components of a network. (04) ( June/July 2013)


5. Define operating system. Discuss functions of operating system.
(06 ) ( June/July 2013)
6. Explain working of hard disk with a neat diagram. Give advantages and
disadvantages. (06) ( June/July 2013)

22
Computer Concepts and C Programming 2016-17

7. Choose the correct answer: (04) (Jan 2013)


v) DOS is an example of interface
(A) Command line (B) Check box (C) Graphical (D) Parallel
vi) Email is a system for exchanging messages through a
(A) Client (B) Program (C) Network (D) back bone
vii) Every web page has a unique address, called a
(A) Hyperlink (B) URL (C) HTTP (D) www
viii) In a n/w all devices are connected hub
(A) bus (B) star(C) ring (D) mesh

8. Define operating system. What are the functions of operating system?


(06) (Jan 2013)
9. Explain the following storage devices i) Hard disk ii) Compact disk.
(06) (Jan 2013)
10. Explain the characteristics of networks. (04) (Jan 2013)
11. Convert the decimal number 37 to binary number?
12. How computers represent data and how this data is processed to get information?
13. What are bits, nibble and bytes?
14. What is ASCII?
15. What are the operations performed by CPU?
16. Can you explain the major elements of CPU?
17. What approach would you use to magnetic core memory?
18. How would classify different system bus?
19. What is memory? Why is it required? What are the different types of memories?
20. What is main memory?
21. Explain with a diagram any one of the secondary storage device?
(Aug/2006).
22. What is volatile and non-volatile memory? What is the difference between the
two?
23. What are RAM and ROM? Explain the differences of RAM and ROM
(06)(Dec/Jan2006)
24. What is CACHE? Why it is used? Explain. (05)(July2007)

23
Computer Concepts and C Programming 2016-17

20. What id a floppy disk. What are the various components of a floppy disk?
21. What is a Hard Disk? Give its advantages and disadvantages.
22. What are the differences between Floppy disk and Hard disk?
23. What is Magnetic tape? What are the advantages and disadvantages of magnetic
tape?
24. What are optical storage devices? Explain the different types of optical storage
devices.
25. Explain how the performance of a drive is measured.
26. How to optimize disk performance? Explain. (06) (Dec 08/ Jan 09)
27. Describe with a neat sketch, the features and working of magnetic tape unit .what
are the merits demerits? ( Jan/Feb 2006)
30. Explain the following storage devices with figure
i) Magnetic tape and ii) magnetic disk (Aug/2008)
31. What is an operating system?
32. What are the purposes or primary functions of the operating system?
33. Differentiate between Graphical user interface and Command user interface
(06)(July 2007)

34. List and explain the four major types of operating systems.
(08) (Dec 08/ Jan09)
35. List any five types of operating system? (06)(July 2008)
36. What is preemptive scheduling and non preemptive scheduling?
42. What is a network?
43. What are the various benefits of using a network?
44. What is a LAN? What are the advantages and disadvantages of LAN?
45. What is a WAN? What are the advantages and disadvantages of WAN?
46. Differentiate between LAN and WAN.
47. What is a Topology? Explain different network topologies.
(08) (Dec 08/ Jan 09)
48. Explain the features of various network topologies. (08) (July 2007)
49. Explain the following terms.

24
Computer Concepts and C Programming 2016-17

a. NICs (Network Interface Cards)


b. Hubs
c. Bridges
d. Switches
e. Routers
UNIT-III
CHAPTER3: FUNDAMENTALS OF PROBLEM SOLVING, INTRODUCTION TO C
LANGUAGE
1. a. Choose the correct answers for the following :(04 Marks) ( June/July 2013)
i) The number 0987 is integer.
a. Octal b. decimal c. hexadecimal d. invalid
ii) What kind of language is C?
a. Machine language b. Procedural language
c. Assembly language d. Object oriented language.
iii) The result after evaluating the expression ½ * 4 is
a) 0.25 b) 2 c) 0 d) 0.125
iv) What is the output if following program executed ?
main( )
{
printf(“%d”,’A’);
}
a) 65 b) A c) “A” d) Error
2. What will be output of the following c program? Justify your answer.
#include<stdio.h>
main(){
int abc=5l;
printf("%d",ABC);
getch();
}
a) 10 b)0 c)compilation error d)5

3. What are the different built-in data types available with C?


6M ( (dec 2013)
4. With an example, explain the structure of a typical C program.
6M( (dec 2013)
5. Briefly write what do you mean by the C tokens.
4M( (dec 2013)

6. Explain software development and life cycle. (04) ( June/July 2013)

25
Computer Concepts and C Programming 2016-17

7. What are identifiers? Discuss the rules to be followed while naming identifiers.
Give examples. (06) ( June/July 2013)
8. Explain format specifiers used in scanf( ) function to read int, float , char, double
and longint datatypes . (06) ( June/July 2013)
9. a. Choose the correct answer: (04) (Jan 2013)
ix) ‘C’ is what kind of language?
(A) Machine (B) Procedural (C) Assembly (D) Object
oriented programming
x) The hexadecimal constant is preceded by
(A) OX (B) O (C) HX (D) H
xi) The number 025 is number
(A) Decimal (B) Octal (C) Hexa (D) Binary
xii) The operator % yields
(A) Quotient (B) Percentage (C) Reminder (D) Fractional part

10. b. Briefly explain how to create and run the program. (06) (Jan 2013)
11. c. Explain f-types of data with its range value. (06) (Jan 2013)
12. d. Explain formatted input and output functions. (04) (Jan 2013)
13. Explain in detail the steps involved in Creating and Running of programs.
14. Describe the basic steps in system development life cycle.
15. What is a flowchart?
16. Explain with example an algorithm and flowchart. (06) (Jul / Aug 2004)
17. What is the need for a flowchart? What are the drawbacks of a flowchart?
Compare and contrast algorithms and flowcharts. (10) ( Jan 2007)
18. What is flowchart symbol? What are the symbols used while writing a flowchart?
19. Write an algorithm and flowchart for the following:
a. Area of a triangle
b. Area of a circle
c. Check whether the given number is odd or even.
d. Check whether a number is +ve, -ve or zero.
e. Exchange the contents of two numbers.
f. Largest of two numbers.
g. Largest of three numbers (08) (Jan / Feb 2003)

26
Computer Concepts and C Programming 2016-17

20. Write an algorithm and flowchart to find the roots of a quadratic equation
showing all the possible conditions. (08) (July/ Aug 2003)
21. Write an algorithm and flowchart to find whether a given number is prime or not.
(05) (Dec 08/Jan 09)
22. Write an algorithm and flowchart to find factorial of a given integer.
(06) (Dec 08/ Jan 09)
23. Write an algorithm to find
b) The total number of even integers
c) The total number of odd integers
d) The sum of all even numbers
e) The sum of all odd numbers
from a given set of 100 integers. (10) (Jan / Feb 2004)
24. Explain the structure of a C program with example.
25. What are identifiers? What are the rules to be followed to frame an identifier?
26. What are keywords? What are the various keywords available in C?
27. Define identifiers, constants and keywords. Give the various rules for formulating
identifiers in ‘C’ language. (08) (July 2007)
28. What are the different types of data types available in C language? Explain with
examples.
29. What is a variable? What is the use or significance of a variable? What are the rules
to be followed while writing variable names?
30. List out the five rules to be followed while having a variable. Give one example for
each rule with invalid case. (06) (Jul/ Aug 2005)
or
31. What are the primary or basic data types available in C language? Explain with
examples.

32. Distinguish between variables and keywords with examples


(08) (July/ Aug 2004)
33. What are constants? List the different types of constants used in C. Give two
examples in each type. (04) (Jan / Feb 2003)

27
Computer Concepts and C Programming 2016-17

34. Pick the incorrect floating point constants and give reasons for the same:
i) 40,945.65 ii) 428.58 iii) 46E2 iv)465. v) 43 (05)(Jan/Feb2004)
35. What are escape sequence characters? Explain with example.
36. What is a string constant? What is the difference between a character .
37. What are Coding constants? Explain the different types of Coding constants.
38. What is a stream? Explain the two forms of streams.
39. What are the various formatted I/O functions in C? Give the syntax of each with
an example.
or
With example, explain scanf() and printf() functions. (06) (Jan/Feb 2003, July
2007)
40. Explain the two levels of program documentation with examples.
41. Explain briefly printf() with format specifiers. (06)(Jul/Aug 2004)
42. Give any three input and three output statements in C, give an example for each.
(12) (Feb/Mar 2005)
40. What if formatted output? Explain output of integer and real numbers, using an
example for each. (08) (May/June 2010)
41. If the variable i, j and k hold 123,105.568 and 0.0006 respectively. Find the output
obtained from the following:
a. Printf(“\n5d%8.2f%f”,i,j,k);
b. Printf(“\n%d\n%.1f\n%8.3f”,i,j,k);
c. Printf(“\n%2d\n%e\n%e”,i,j,k);
d. Printf(“\n%d\n%.2e%.4f”,i,j,k); (04)(Jul/Aug 2005)

42. Give the basic structure of a C program and explain with an example to find the
area and circumference of a circle of radius ‘r’. Give the purpose of each line in the
program. (08) (Jul/Aug 2003)
43. Write the structure of C program for an example of finding largest of three given
integer values. (08) (Jul/Aug 2004)

44. Define the following with examples (08) (May/June 2010)

28
Computer Concepts and C Programming 2016-17

i) Token
ii) Keyword
iii) Identifier
iv) Variable
45. Can you write a c program without using main function and explain in detail?
46. Can you propose atleast 3 alternatives to find whether the given number is odd or even
with appropriate algorithms and flowcharts?
47. How to calculate the square root of a number in c programming source code.
48. Analyze cyclic property of data type in c? Explain with any example.
49. “C supports rich set of data types” justify this statement.
50. Distinguish between string constant and character constant.
51. When do you say a variable is valid variable give an appropriate examples.

UNIT-IV
CHAPTER 4: STRUCTUE OF A C PROGRAM
1. a. Choose the correct answers for the following : (04 Marks) ( June/July2013)
i) An operator which acts on two operands to produce result is
operator.
a) Ternary b) binary c) unary d) Complex
ii) The modulus operator (%) can be used only for values.
a) floating b) integer c) both integer and floating d) all
data type
iii) In C, TRUE is represented by
a) True b) zero c) non-zero d) 1
iv) Which of the following is not valid assignment statement ?
a) i + j = 23 b) j = 23 c) j + = 23 d) j = 23 + i

2. Explain relational operators in C, with examples.


6M ( (dec 2013)
3. With an example, explain the Unary operator in C language.

4M ( (dec 2013)
4. Explain in detail about Bitwise operators in C language
6M ( (dec 2013)

5. Write C program to swap values of two integers without using third variable and
give flow chart for the same. (06) ( June/July 2013)
6. Find result of each of the following expressions with I = 4, j = 2, k = 6, a = 2.
i) k * = i + j ii) j = i/ = k iii) i% = i/3

29
Computer Concepts and C Programming 2016-17

iv) m = I + (j = 2 + k) v) a = i*(j/ = k/2)


(10) ( June/July 2013)

7. a. Choose the correct answer: (04) (Jan 2013)


xiii) What is the size of character in bytes
(A) 1 (B) 2 (C) 3 (D) 4
xiv) Puts is function.
(A) i/p (B) o/p(C) Input Output (D) None
xv) The conversion specifier _ is used to represent string.
(A) %d (B) %c (C) %f (D) %s
xvi) Keywords are
(A) Identifier (B) Reserved words (C) Variable (D) None

8. What do you mean by type conversion? Explain explicit type conversion with
examples. (04) (Jan 2013)
9. Explain the following operators with examples: (09)(Jan 2013)
i) conditional ii) size of iii) Bitwise.
10. Determine the value of a each of the following logical expressions, where a=5,
b=10 and c=-6. (03)(Jan 2013)
i) a>b && a>c ii) b>15 && c<0 || a>0 iii)(a/2.0==0.0&&b/2.0 |=0.0)||c<0.0.
11. What is an expression? Differentiate simple and complex expressions. Mention the
different expression categories.
12. What are the different expression categories? Explain any three expression
categories with examples.
13. Explain postfix and prefix expressions with examples.
14. Explain unary and binary expressions in detail.
15. Explain the precedence and associativity in expressions.
16. What are side effects? Explain with examples, expression with and without side
effects.
17. What is type conversion? What are the different type conversion techniques?
Explain with an example.
18. Explain the different statement types in C.
19. Explain with examples:
i) Increment operators ii) Decrement operators iii) Conditional operators
(Dec 08/Jan 09)

30
Computer Concepts and C Programming 2016-17

20. Evaluate each of the following expressions independent of each other. The
declaration and initialization statement is int i=3, j=4, k=2;
a. i++ - j--
b. ++k % --j
c. j + 1/i –1
d. j++ / i— (08) (Jan/Feb 2003)
21. In the following expression, write the hierarchy of computation and also mention
the type of operator
a*x*x + b*x - c/d >= && z!=15.0 (04)(Jan/Feb 2003)
22. What would be the value of an expression after the execution of the following
expressions. Assume the initial value of a=5
a. a+ = (a++) + (++a)
b. a = (--a) – (a--) (08)(Feb/mar 2005)
23. Write the expressions in C language and evaluate the arithmetic expressions,
i) b (a+b)2 ii) 2ab
a2 (a-b) a+b (06) (Jul/Aug 2003)
24. Write C expression corresponding to the following (Assume all quantities are of
type float) (06)(Jan/Feb 2004)
i) ax+b ii) 2x+3y iii) x5+10x4+8x3+4x+2 iv) (4x+3)(2y+2z+4) v) a
ax-b x-6 b(b-a)
25. Find the values of variable x and m after the execution of the following statements
i) x=15 ii) x=15
m=x++; m=++x; (02) (Jul/Aug 2005)
26. Find the values of the variables in the following program segment
a. int a, b, c; b. int a,b:
float x,y; float x:
a=10; a=25/10+6.5;
b=15; b=25/10+6.6;
c=b/a; c=25/10+6.6;
x=b/a;
y=(float)b/d; (06)(Jul/Aug 2005)

31
Computer Concepts and C Programming 2016-17

27. What is the output of the following ‘C’ statement


x = 3, y = 5;
y = + x – y;
y = ++ y;
printf(“%d”,y);
a) Error b) 1 c) 0 c)-1 (01)(Dec08/Jan 09)
28. Differentiate between increment and decrement operators.
29. What is Implicit type and Explicit type conversions. Differentiate between them.
30. What do you mean by associativity of an operator? What is left associativity and
right associativity?
31. Write the C statement using ternary operator to perform the following:
a) Find the Largest of two numbers.
b) Check whether the given integer number is Positive or negative
c) Find the Largest of three numbers
d) Check whether a character is alphabet or not.
e) Check whether the alphabet is in lower case or upper case.
f) Convert the lower case alphabet to upper case and vice versa.
g) Check whether a given year is leap year or not.
h) Check whether the given integer number is odd or even.
32. Evaluate the following expressions and show their hierarchy
(a) 2*((i/3)+4*(j-2)) where i = 8, j = 5
(b) a&&b||c&&(!b) where a = 2, b = 4, c = 3
(c) (a>b)&&(c= =3) where a = 2, b = 4, c = 3
(d) (a!=c)||(b= =c) where a = 2, b = 4, c = 3
(e) !(5+5>=10)
(f) 5 + 5 = = 10 || 1 + 3 = = 5
(g) 5 >10 || 10 < 20 && 3 <5
(h) 10 != 15 && !(10 < 20) || 15 >30
(i) (a/2.0 = = 0.0 && b/2.0 != 0.0) || c < 0.0 where a = 5, b = 10, c = -6
(j) b>15&&c<0||a>0 where a = 5, b = 10, c = -6
(k) a = b++ - c*2 + ++a – a-- where a = 5, b = 10, c = -6
33. Determine the value of each of the following logical expressions if a=5,b=10 and
c=-6 :
a) a >b && a<c b) a<b && a>c
c) a==c || b>a d) b>15 && c<0 || a>0

UNIT-V

32
Computer Concepts and C Programming 2016-17

CHAPTER 5: FUNCTIONS
1. Choose the correct answers for the following : (04 Marks) (Dec 2013/Jan
2014)
i. The function that calls itself is called as
a) forwarding function b) conditional function
c) recursive function d) background function
ii. The main() work is defined in library
a) stdio.h b) conio.h c) string.h d) math.h

iii. parameter passed as arguments to the function call are called as


a)actual parameters b)formal Parameters c)No Parameters
d)None of these.
iv. Which of the following return statements in a function has error
a) return b) return(0) c) return(expression) d) None of
these

2. What is function? Describe with declaration syntax? (04 Marks) (Dec 2013/Jan
2014)
3. Describe the two ways of passing parameters to function with example? (08
Marks) (Dec 2013/Jan 2014)
4. write a program to test whether or not a given integer number is prime with
function? (04 Marks) (Dec 2013/Jan 2014)
5. a. Choose the correct answers for the following : (04 Marks) ( June/July
2013) i) In c, default return type of function is .
a) void b) int c) float d) char
ii) Parameters used in function call are parameters.
a) Formal b) local c) dummy d) actual

iii) Every C program must have .


a) user defined function b) Standard function c) main function
d) library function.
vi) Arguments of a functions are separated with .
a) Comma( , ) b) semicolon ( ; ) c) colon ( : ) d) blank space (/b)
6. Write C program to print n Fibonacci numbers using function.(08) ( June/July
2013)
7. Differentiate call by value and call by address parameter passing mechanisms.

33
Computer Concepts and C Programming 2016-17

(04) ( June/July 2013)


8. Explain the scope of local and global variables with simple example.
(04) ( June/July 2013)
9. Choose the correct answer: (04) (Jan 2013)
xvii) The default return type of a function is
(A) int (B) float (C) char (D) double
xviii) How many values returned by functions by default
(A) ONE (B) TOW (C) THREE (D) FOUR
xix)Which is not a variable storage class
(A) Automatic (B) Extern (C) Static (D) Dynamic
xx) Which keyword is used to declare external variable.
(A) external (B) extern (C) auto extern (D) None

10. Explain the elements of user defined functions. (06) (Jan 2013)
11. Write a function prime that returns 1, if its argument is a prime number and
returns O. Otherwise using the same function, write a program to check whether
the number is prime or not (05) (Jan 2013)
12. Write a note on parameter passing technique. (05)(Jan 2013)
13. What is a function? Give the structure chart for a C program and also explain the
function concept.
14. What are User Defined Functions and Library Functions? Can you make a
distinction between them?
15. Explain in detail the basic function designs with examples.
16. Write a C program to find the square of a given number using both UDFs and
library function.
17. What is function definition? Explain with example.
18. What are the elements of user defined functions?
19. What is calling function and what is called function? Can you make a distinction
between them?
20. Explain in detail about function declaration.
21. Explain in detail about function call.
22. What are formal and actual parameters? What is the difference between them?
23. Describe about the Inter-function communication using the different dataflow
strategies.
24. With examples, explain the different ways of passing parameters to a function

34
Computer Concepts and C Programming 2016-17

(08) (Dec 08/ Jan 09)


or
Explain pass by value and pass by reference and differentiate them with example.
25. Explain the three types of communication implemented in C for Inter-function
communication.
26. What are Standard Funtions? Explain any standard function in C.
27. Describe the Math functions in C.
28. What is Scope of a program? Explain Global scope and Local scope with examples
29. Briefly explain the different elements of User defined functions. Write a function
to compute factorial of a given number. Call the function with n=5 and print the
result in main. (08)(May/June 2010)
30. Write a C program for the following using user-defined functions
a. To reverse a number and check whether it is palindrome or not.
b. To find GCD of two numbers.
c. To search for an element using linear search.
d. To sort the given elements using bubble sort.
e. To sort the given elements using selection sort.
f. To multiply two matrices.
g. To compute mean, variance and deviation.
h. To find smallest of n numbers using arrays
i. To compute A3 +A2 +A where A is a square matrix (08) (Jan 2007)

31. Write a user defined function to find the product of two matrices of order (nxn)
and use it in a main function to compute A 3 +A2 +A, where ‘A’ is a matrix of order
(nxn). (20) (Dec 08/ Jan 09)

UNIT-VI
CHAPTER 5, 6: SELECTION-MAKING DECISIONS, REPETITION
1. Choose the correct answers for the following : (04)(Jan 2014)

35
Computer Concepts and C Programming 2016-17

i) Which of the following looping construct is an entry controlled loop


a) while b) do while c) for d)None of These
ii) Which of the following is a conditional statement that tests a value against
different value ?
a) while b) for c) switch d) if
iii) Which of the following is not a jump loop
a) break b) continue c) gotod) for
iv) Which of the following is a exit controlled loop
a)if b)do while c)while d) if-else

2. write and explain the declaration systax for while and do-while loop? (04 Marks)
(Dec 2013/Jan 2014)
3. write a C program to compute sum of n numbers? (06 Marks) (Dec 2013/Jan
2014)
4. write a program to check whether the given alphabet is vowel or not using switch
statement? (06 Marks) (Dec 2013/Jan 2014)
5. Choose the correct answers for the following : (04)(June/July 2013)
i) break statement can be used in .
a) if b) if – else c) nested if d) while
ii) Which of the following is not comparator operator in C ?
a) < b) > c) = d) !=
iii) What is the output if following loop is executed ?
for( i = 1; i < 5; i++); printf(“VTU”);
a) syntax error b) VTU
c) VTUVTUVTUVTUVTU d) infinite times
6. Write C program to find roots of quadratic equation. Consider all possible cases of
roots. (06) ( June/July 2013)
7. Write C program to evaluate following expression :
answer = 1 + x + (x2)/2! + (x3)/3! + (x4)/4! + ……… using function.
(06) (June/July 2013)

36
Computer Concepts and C Programming 2016-17

8. Differentiate pre – test and post-test loops. Illustrate your answer with a suitable
example. (04) ( June/July 2013)
9. Choose the correct answer: (04) (Jan 2013)
i) Multi way decision making using _
(A) if (B) for (C) while (D) switch
ii) 5>3? Printf(“hello”:printf(“C”);
(A) hello (B)C (C) hello C (D) None
iii) The result of an expression 2>8 && 2<8 is
(A) True (B) False (C) 10 (D) 20
iv) Size of (float) is
(A) 2 (B) 4 (C) 8 (D) 1

10. Explain switch statement with flowchart and write a program to display name a
day in week for the given day number, assume day one is Monday. (06) (Jan
2013)
11. Write a program to find the given number palindrome or not using while loop
(05) (Jan 2013)
12. Write a program to find a square of a given number using for loop.
(05)(Jan2013)
13. What are Logical operators? Explain the different logical operators in C.
14. Explain the following operators with examples
a. Logical operators
b. Relational operators
c. Conditional operators (06) (Jul/Aug 2003)
15. Explain the different Comparative operators in C?
16. Explain in detail Two-way selection in C.
17. What is an if-statement? What are the varieties of if-statements? Explain along
with syntax? (08) (Jan 2007)
18. Write a C program for the following using different branching statements,
a. To check for even number.
b. To find largest of three numbers.
19. Write a C program to calculate area of circle, rectangle and triangle using switch.
(10) (July 2007)

37
Computer Concepts and C Programming 2016-17

20. Write a program to find the roots of Quadratic equation. Check for all error
conditions. (06) (Dec 08/ Jan 09)
21. Write an algorithm and flowchart to find the largest of three numbers. Write the
corresponding C program.
22. Write a program to check whether the given number is positive, negative or zero
number. Write the algorithm or flowchart for the same.
23. Write a program to check whether the given number is odd or even. Write the
algorithm or flowchart for the same.
24. What are Conditional expressions? Explain with examples.
25. Explain in detail Multiway selection in C.
26. With an example, explain switch statement and significance of break in switch
block (10) (Dec 08/ Jan 09)
27. Write a C program to simulate a simple calculator using else-if ladder and switch
statement.
28. Write a C program to read three integers and print the largest using nested if
statement. If all the three integers are equal, appropriate message must be
displayed. (08)(May/June 2010)
29. What is a loop control expression? Explain Pretest and Post-test loops with
examples.
30. Explain Loop Initialization and Loop Updating.
31. Compare Pretest and Post-test loops.
32. What is a for loop? Explain with syntax, flowchart and example. Give the working
of for loop. (08) (Jan 2007)
33. Explain while-loop along with syntax.
34. Explain do-while statement along with syntax.
35. Differentiate between while and do- while loops. Give one example for each
(08)(July 2007)
36. What is Comma expression? Explain with an example.
37. Explain break statement in C. (05) (July 2007)
38. Differentiate between Break and Continue statements in C.
39. Write a ‘C’ program to find whether a given integer is prime. Use FOR loop.

38
Computer Concepts and C Programming 2016-17

(08) (July 2007, Dec 08/ Jan 09)


40. Write a C program using do…while loop to calculate and print first N Fibonacci
numbers. (08) (Dec 08/ Jan 09)
41. Write an algorithm and C program to generate N fibonacci numbers.
42. Write an algorithm and C program to reverse an integer and check whether it is
palindrome or not.
43. Write an algorithm and C program to find GCD and LCM of two numbers.
44. Write an algorithm and C program to reverse a number and to find the sum of
digits of a number of a number.
45. Write a C program to compute sum of series 1 + x + x2 + x3 +……xn.
(06) (Jan 2007) / (08) (May/June 2010)
46. Write a C program to find GCD of two non-zero integer numbers. If the first
number is less than the second, then the program must exchange the two numbers
before computing the GCD. (08) (May/June 2010)
47. Write a C program for the following using for, while and do while loop,
a. To find the sum of first N natural numbers.
b. To find the factorial of N numbers.
c. To find sum of even and odd numbers.
d. To find sum of squares of first N natural numbers.
48. Write a C program to add numbers which are divisible by 7 within a range 100 to
200.
49. Write a C program to print the following output using nested loops

i) 1
2 2
3 3 3
4 4 4 4

i) 1
2 3
4 5 6

39
Computer Concepts and C Programming 2016-17

7 8 9 10
50. Explain the different Looping Applications.
51. What is Recursion? Explain a simple problem using Recursive and Iterative
solution.
52. What is Recursion? Explain the Tower of Hanoi problem and give a recursive
solution for the same.
53. Can you propose an alternative program to grade the student based on his marks
scored in exam without using if-else condition?

UNIT-VII
CHAPTER 13: ARRAYS, STRING

1) Choose the correct answers for the following. (04 Marks) (Dec 2013/Jan
2014)
i) In an Array a[5]={10,20,30,40,50}; The element 40 is designated as
a) a[0] b) a[1] c) a[3] d) a[4]
ii) In an Array int a[2][3]={10,20,30,40,50,60}; The array a[0][1] element is
a) 10 b) 40 c) 60 d) 20
iii) Which of the following string handling function is used to add two strings
a) strcat() b) strncat() c) strcmp() d) strlwr()
iv) Which of the following string handling function is used to compare two strings
a) strlen() b) strcmp() c)strcpy() d) strrev()

2) Write a program to test whether the given string is a palindrome or not. (05
Marks) (Dec 2013/Jan 2014)
3) Write a program to read two matrices from keyboard and print the sum of two
matrices. (07 Marks) (Dec 2013/Jan 2014)
4) Define an array. How are they declared in C language? (04Marks) (Dec
2013/Jan 2014)
5) Choose the correct answers for the following : (04)( June/July 2013)

40
Computer Concepts and C Programming 2016-17

i) The subscript of first item of ab array in C is always .


a) 1 b) 0
c) depends in size of array d) not fixed and assigned at run-time.
ii) In a variable length string, the string ends with delimiter.
a) \n b) \0 c) \b d) none of these iii) Which of
the following is correct declaration of array in C ?
a) int marks [3 + a]; b) float marks [5,5];
c) int marks [2 - 2]; d) int marks [ 5 ];
iv) ASCII stands for
a) American Standard Code for International Information
b) American Standard Company for International Integration c)
American Standard Code for International Integration d)
American Standard Code for Information Interchange.
6) Design and Implement C program to search an element from unsorted list using
binary search. (12)( June/July 2013)
7) Differentiate between a character and a string containing a single character?
(04) ( June/July 2013)
8) Choose the correct answer: (04) (Jan 2013)
i) Array is an example of _data types
(A) Derived (B) Basic (C) User defined (D) None
ii) An array a[5] consists of number of elements.
(A) 10 (B)5 (C) 25 (D) None
iii) An array a[5][3] consists of elements
(A) 5 (B) 3 (C) 15 (D) None
iv) Which of the following is not a data structure.
(A) Linked List (B) Stack (C) Queue (D) Pointer

9) Illustrate, how a 1-dimensional array can be declared and initialized, apply array
concept to write a C program to add all the ‘n’ elements of an array.
(06) (Jan 2013)
10)Explain the following string handling functions, with examples: i) strcat ii) strcpy
(04) (Jan 2013)
11) Write a C program to
multiply A[M X N] and B[p X Q] matrices and stores the resultin C matrix.
(06) (Jan 2013)
41
Computer Concepts and C Programming 2016-17

12)What is an Array? What are its advantages and disadvantages?


(04) (Dec 08/Jan 09)
13) Define Array. What is the
use of using arrays? How are they declared in C? Whatare the rules to be
followed while using arrays? (08) (Jul/Aug 2005)
14)What is single dimensional array? How single dimensional array can be
initialized? Explain with example.
15)Compare single dimensional array with two dimensional array? What are the
different ways of initializing a single dimensional array? Explain.
16)Write a C program to read and write a single dimensional array.
17)Write a C program to generate N fibonacci numbers using arrays
(08) (Jan 2007)
18) Analyze, design and implement a C program to read n integer numbers
interactively and to print biggest and smallest of n numbers.
(06) (Jul/Aug 2004)
19) Write a C program for the following using single dimensional array
i. To find addition of N elements in an array and their average.
ii. To find sum of +ve, -ve numbers and their average.
iii. To generate Fibonacci numbers.
iv. To find largest of N numbers. (08) (Jan 2007)
20) Write a C program to input N real numbers in ascending order into a single
dimension array. Conduct a linear search for a given key integer number and
report success or failure in the form suitable message.
(06) (Dec 08/Jan 09)
21) Design and write a C program to input N real numbers in ascending order into a
single dimension array. Conduct a binary search for a given key integer number
and report success or failure in the form suitable message.
(12) (July 2007)
22) Without using Global variables, write a C program, by implementing these
functions i) Read N array elements ii) Print N array elements and iii) Conduct
Binary search for a given key integer number in N array elements (08) (Dec 08/
Jan 09)

42
Computer Concepts and C Programming 2016-17

23) Evaluate the given polynomial f(x) = a4 x4 + a3 x3 + a2 x2 + a1 x + a0 for given


value of x and the coefficients using Horner’s method and write a C Program to
solve the same (using single dimension array) (06) (Dec 08/
Jan 09)
24) What is two dimensional array? How two dimensional array can be initialized?
Explain with example.
25) What is two dimensional array? How to declare it and what are the different ways
of initializing a two dimensional array? Explain.
26) Write a note on one dimensional and two dimensional arrays with example
(06) (Jul/Aug 2003)
27) Write a C program to read and write a two dimensional array.
28) Write a C program to multiply two given matrices A and B, and store the result in
C. (08) (Jan / Feb 2003)
29) A and B are two arrays with 10 elements. Write a program to find array C such
that
C[0] = A[0] + B[9]
C[1] = A[1] + B[8]
C[2] = A[2] + B[7]
C[3] = A[3] + B[6]
…………………..
…………………..
C[8] = A[8] + B[1]
C[9] = A[9] + B[0] (10)(Jan 2006)
30) Given two sets A and B of integers, Design and write a C program to read them,
determine its UNION and INTERSECTION and print the resultant sets. (10)
(Feb/March 2005)
31) Write a program to find the intersection of 2 arrays A and B with size m and n
respectively. (08) (Jan 2006)
32) Describe string input and output functions?
33) Can you propose an alternative solution to calculate length of a string without
using built-in function?

43
Computer Concepts and C Programming 2016-17

34) Explain the following string handling functions


i)strlen ii)strcmp iii)strcat iv)strcpy
35) Write a program that accept a string at the runtime and display the same string
after converting the character of the string into upper case?

44

You might also like