You are on page 1of 40

191CS111 INTRODUCTION TO PROGRAMMING IN C

QUESTION BANK

S.NO Q&A CO K
LEVEL
PART- A
1 Who is the father of c language? CO1. K1
a. Steve Jobs 1
b. James Gosling
c. Dennis Ritchie
d. RasmusLerdorf

2 _________ Generation of computer started with using vacuum CO1.1 K1


tubes as the basic
a. 1st
b. 2nd
c. 3rd
d. 4th

3 The period of ____ generation was 1952-1964 CO1.1 K1


a. 1st
b. 2nd
c. 3rd
d. 4th

4 A hybrid computer is the one which exhibits the feature of _ _ CO1.1 K2


A.analog computer
.digital computer
c.both analog and digital computer
d.mainframe computer

5 In which of the following applications are analogy computer used? CO1.1 K2


a.Measurement of Electric Current
b. Measurement of frequency
c. Measurement of Resistance of a capacitor
d. All of the above

What is computer organization? CO1.2 K1


6 a) structure and behaviour of a computer system as observed by
the user
b) structure of a computer system as observed by the developer
c) structure and behaviour of a computer system as observed by
the developer
d) All of the above

7 Which of the following is the subcategoryof computer architecture? CO1.2 K2


a) Microarchitecture
b) Instruction set architecture
c) Systems design
d) All of the above

8 To reduce the memory access time we generally make use of CO1.2 K1


______
a) SDRAM
b) Heaps
c) Cache memory
b) d) Higher capacity RAM
9 The data is transferred over the RAMBUS by _______ CO1.2 K1
a) Blocks
b) Swing voltages
c) Bits
d) Packets

10 Every rational number is a – C01.3 K1


a) Whole number
b) Real number
c) Natural number
d) None of the above

11 Suppose there is a number 'n'. When 'n' is divided by 5, the C01.3 K2


remainder will be 2. What will be the remainder when n2 is divided
by 5?
a) 6
b) 4
c) 1
d) 8

12 The number of characters in 8bit ASCII Code (American Standard CO1.3 K1


Code for Information Interchange) is
a.64
b.128
c.256
d.512

13 What is binary equivalent of the decimal number 67.625? CO1.5 K3


a.1000010.110
b.1000011.110
c.1000010.101
d.1000011.101

14 Which of the following number system uses A-F system? CO1.4 K1


a. Binary
b. Octal
c. Hexa-decimal
d. Decimal

15 Macro flowchart is also called as CO1.8 K1


a. Simple detailed flowchart
b. less detail flowchart
c. more detail flowchart
d. None of the above

16 Pseudocode is used for CO1.7 K1


a. Denoting the program flow
b. program code
c. coding the program
d. write program steps

17 Which method uses a list of well-defined instructions to complete a CO1.7 K2


task starting from a given initial state from a given initial state to
end state
a) Program
b)Flowchart
c) Algorithm
d)A &B

18 Flowcharts and algorithmsare used for better programming C01.6 K1


a) Easy testing and debugging
b) Efficient coding
c) Allof the above

19 ENIAC stands for __________ CO1.1 K1


a) Electronic Numerical Integrator And Computer
b) Electronic Numerical Integrator And Calculator
c) Electronic Numerical Integrator Automatic Computer
d) Electronic Numerical Integrator Automatic Calculator

20 Which electronic components are used in third generation CO1.1 K1


computers?
a) Transistors
b) Integrated Circuits
c) Vacuum Tubes
d) VLSI Microprocessor
e) ULSI Microprocessor

21 __________ is used as a programming language in first generation CO1.1 K1


computers?
a) FORTRAN
b) COBOL
c) BASIC
d) Machine Language

22 How many bits make a byte? CO1.3 K2


a) 2 bits
b) 4 bits
c) 8 bits
d) 12 bits

23 Convert 2 bits into bytes CO1.3 K2


a) 0.10
b) 0.25
c) 0.35
d) 0.40

24 The algorithmic approach is better than flow-charting CO1.8 K2


a.True
b. False

25 Algorithms should be formulated using high level languages. CO1.6 K2


a.True
b. False
26 C was primarily developed as
a. System programming language
b. General purpose language CO2.1 K1
c. Data processing language
d. None
27 Standard ANSI C recognizes ___ number of keywords?
a.30
b.32 CO2.4 K1
c.24
d.36
28 A C variable cannot start with____
a. Number
b. A special symbol other than underscore CO2.5 K1
c. Both of above
d. An alphabet
29 What is the input file in a C programming building process?
a. filename.k
b. filename.cpp CO2.2 K1
c. filename.c
d. filename.p
30 What is the first step in the C program building process?
a. Compiling
b. Assembling CO2.1 K1
c .Linking
d. Pre-processing
31 Which one of the following is a loop construct that will always be executed once?
a. for
b .while CO2.8 K1
c. switch
d .do while
32 Directives are translated by the
a. Pre-processor
b .Compiler CO2.2 K1
c. Linker
d .Editor
33 Which one is the correct description for the variable balance declared below?
Int ** balance
a.Balance is a point to integer CO2.8 K2
b.Balance is a pointer to a pointer to an integer
c. None of these above
34 Which one is not a reserve keyword in C Language?

a.Auto
CO2.4 K1
b.Main
c.Case
d.Register
35 A C variable name can start with a ___ CO2.5 K1
a.Number
b.Plus Sign (+)
c. Underscore
d. Asterisk (*)

36 A global variable is declared __________.


a. Outside of the function
b. Inside of the function
CO2.5 K2
c. With the function
d. Anywhere in the program

37 Which of the following variable name is correct in c language


a. For
b. for
CO2.5 K1
c. Basic salary
d. hello

38 Which of the following header files is used for character type function in C
language?
a. <assert.h>
b. <ctype.h> CO2.4 K1
c. <iostream.h>
d. <locale.h>

39 Which of the following is the variable that can be used for all functions?
a. Static variable
b.Global variable
CO2.5 K2
c. Local variable
d. Dynamic variable

40 C language handles decision-making by supporting


a) 3 statements
b) 4 statements
CO2.9 k1
c) 5 statements
d) 6 statements

41 Nesting if-else statements are used

a) When a series of decisions are concerned


CO2.7 K2
b) When a single of decision is concerned
c) No decision are allowed
d.) None of these above
42 In the if-else statement, if the test condition or expression is true then C02.6 K2
a.True statements-block is executed
b.False statements-block is executed
c.Both true and false statements are executed
d.None of these

43 If statement is
a) Two-way decision making statement
b) Single way decision making statement
CO2.8 K1
c) No way decision making statement
d) None

44 Which of the following operators takes only integer operands?


a) +
b) *
CO2.7 K1
c) /
d) %

45 Operator % in C Language is called?


a) Percentage Operator
b) Quotient Operator
CO2.7 K1
c) Modulus
d) Division

46 PREDICT THE OUTPUT


#include <stdio.h>
int main()
{
float c = 5.0;
printf ("Temperature in Fahrenheit is %.2f", (9/5)*c + 32);
return 0; CO2.9 K3
}
a.Temperature in Fahrenheit is 41.00
b.Temperature in Fahrenheit is 37.00
c.Temperature in Fahrenheit is 0.00
d.Compiler Error

47 What is the value of a?


int a = 3.5 + 4.5;
a) a = 0
CO2.9 K3
b) a = 7
c) a = 8
d) a = 8.0
48 An array is a_________

A. Collection of different type of elements

B. Collection of similar type of elements C03.1 K1


C. None of the above

D. Both A and C

49 What happens when you try to access an Array variable outside its size?
A) Compiler error is thrown
B) 0 value will be returned CO3.1 K1
C) 1 value will be returned
D) Some garbage value will be returned.
50 An array elements are always stored in ________ memory locations.

A. Random

B. None of the above


CO3.1 K1
C. Sequential

D. Sequential and Random

51 Which of the following statement is true in an array?

A. A data structure that shows a hierarchical behavior

B. Container of objects of similar types


CO3.1 K1
C. Arrays are immutable once initialized

D. Array is not a data structure

52 Array index start at


a. 1

b. User Defined
CO3.2 K2
c. 0

d. None of above

53 The right way to Initialize an array______

A. intnum[6] = { 2, 4, 12, 5, 45, 5 };

B. int n{} = { 2, 4, 12, 5, 45, 5 }; CO3.2 K1


C. int n{6} = { 2, 4, 12 };

D. int n(6) = { 2, 4, 12, 5, 45, 5 };

54 When size of the array need not be specified? CO3.2 K2


A. It is a formal parameter

B. It is a declaratrion

C. Initialization is a part of definition

D. All of these
55 Types of array are_____

A. int, float, char, double

B. struct, enum CO3.3 K1

C. long

D. All the above


56 The fastest way to exchange two rows in a two-dimensional array
is________.
a. exchange the addresses of each element in the two rows.
b. exchange the elements of the two rows. C03.3 K2
c. store the addresses of the rows in an array of pointers and exchange the
pointers.
d. exchange both address and pointers in each row.
57 Which of following one is correct way of declaring 2D array?

a) a[ ][ ];
b) a[ ][ ]={2,4,5,3,8,1,7,8}; CO3.3 K2
c) a[3][4]={2,4,6,8,9,7,5,3,1};
d) a[3][4];
58 ____ maximum number of dimensions in an array.

A. 2

B. 8
CO3.4 K1
C. 16

D. Theoretically no limit. The only practical limits are memory size and

compilers

59 A character array always ends with________.


a. null (\0) character.
b. question mark (?). CO3.4 K2
c. full stop(.).
d. exclamation mark(!).
60 ______is the macro defined in the header string. h. CO3.4 K2
a) NULL
b) zero
c)pass
d)none of these above
61 The string always ends with__________.
a. \0 character.
b. \character. CO3.5 K2
c. 0\ character.
d. 0 character.
62 If you delete array without stating the elements it will be set to________.
a. a null value.
b. zero. CO3.5 K2
c. garbage value
d. no value.
63 _______is the format specifier used to print a string or character array in C

Printf or Scanffunction.?

A) %c
CO3.5 K2
B) %C

C) %s

D) %w

64 What is the ASCII value of NULL or \0?

int main() {
  char str[] = {'g', 'l', 'o', 'b', 'a', 'l'};
  printf("%s", str);
  return 0;
}
CO3.5 K3

a) 12
b) 0
c) 56
d) None of these

65 The ______ function appends not more than n characters.


a) strcat()
b) strcon() CO3.6 K1
c) strncat()
d) memcat()
66 Let x be an array. Which of the following operations are illegal?
I. ++x
II. x+1 CO3.6 K2
III. x++
IV. X*2
a) I and II
b) I, II and III
c) II and III
d) I, III and IV

67 strcmp() function is to __________

A. copies the string

B. compares the string


CO3.6 K2
C. memories values

D. undefined function

68 What is the output of C Program with Strings?

int main()

char str[]={'g','l','o','b','e'};

printf("%s",str);

return 0; CO3.6 K2
}

A) g

B) globe

C) globe\0

D) None of the above

69 Which function will you choose to join two words?

A. strncon()

B. memcon() CO3.6 K2
C. strcpy()

D. strcat()

70 _____is the maximum length of a C-String. CO3.6 K1

A) 32 characters

B) 64 characters

C) 256 characters

D) None of the above


71 Which of the following statements are correct? CO3.7 K2
1: A string is a collection of characters terminated by '.

2: The format specifier %s is used to print a string.

3: The length of the string can be obtained by strlen().

4: The pointer CANNOT work on string.

A. 1,2

B. 1,2,3

C. 2,4

D. 3,4

72 If the two strings are identical, then strcmp() function returns

A. 0

B. 1 C03.7 k1
C. -1

D. None of the above

73 How do you convert this char array to a string?

Char str[]={'g','l','o','b','y'};

A) str[5] = 0;

B) str[5] = '\0'
CO3.7 K3
C) str[]={'g','l','o','b','y','\0'};

D) All the above

74 Choose a correct statement about C String.

a) A string is a group of characters enclosed by double quotes


b) If a string is defined with double quotes, NULL is automatically added at the
end CO3.7 K2
c) Size of a string is without counting NULL character at the end
d) All the above

75 Use_______to determine the null-terminated message string that corresponds to C03.8 K2


the errorcode.
a)strerror(
b)strstr()
c)strxfrm()
d) memset()
76 What is the output of C program with arrays?
int main()
{
intary(3)=[20,30,40];
printf("%d", a(1));
CO3.8 K2
}
A) 20
B) 30
C) 0
D) Compiler error
77 Arrays are passed as arguments to a function by_________.
a. value.
b. reference. CO3.8 K1
c. value, reference.
d. recursion
78 A function which calls itself is called a ___ function.
A) Self Function
B) Auto Function CO4.1
K1
C) Recursive Function
D) Static Function

79 Prior to using a pointer variable it should be 

a) Declared
CO4.5 K1
b) Initialized
c) Both declared and initialized
d) None of these
80 In C a pointer variable to an integer can be created by the declaration

a) int p*;
b) int *p; CO4.5 K1
c) int +p;
d) int $p;

81 A pointer variable can be CO4.6 K2

a) Passed to a function
b) Changed within a function
c) Returned by a function
d) Can be assigned an integer value
82 What is the output of the following C code?

char *ptr;
charmystring[] = "abcdefg";
ptr = myString;
ptr += 5; CO4.6 K3
a)Fg
b)efg
c)defg
d)cdefg
e)bcdefg
83 Will this program compile?

intmain() {
charstr[5] = "LetsFind";
return0;
CO4.6 K3
}
a)True
b)False
c) may be
d)Can’t say
84 The keyword used to transfer control from a function back to the calling
function is____
A. switch
CO4.4 K2
B. goto
C. return
D. exit
85 A pointer is a

a) variable that stores address of an instruction


b) variable that stores address of other variable CO4.7 K1
c) keyword used to create variables
d) None of these

86 The address stored in the pointer variable is of type _______.

a) Integer
b) Float CO4.4 K1
c) Array
d) Character

87 __________is the basic data type of a function variable. CO4.1 K2

a)int
b) float
c) No datatype
d) Depends upon the type of the variable to which it is pointing
e) unsigned int

88 A function that calls itself is called a ___ function.

a) Self Function
b) Auto Function CO4.2 K1
c) Recursive Function
d) Static Function

89 Select the correct statement about functions in the C programming


language. 

a) A Function is a group of c statements which can be reused any number


CO4.1 K2
of times
b) Every Function has a return type
c) Every Function may no may not return a value
d) All the above
90 ________ are the types of functions in the C language.

a) Library Functions
b) User Defined Functions CO4.1 K1
c) Both Library and User Defined
d) None of the above

91 Choose correct statements about C Language Pass By Value.

a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
CO4.3 K2
c) Pass By Value protects your source or original variables from changes
in outside functions or called functions
d) All the above

92 The default parameter passing mechanism is

A. Call by value
B. call by reference CO4.3 K1
C. call by value result
D. None

93 Pick the correct statements. CO4.4 K2


I. The body of a function should have only one return statement
II. The body of a function may have many return statements.
III. Function can return only one value to the calling environment.
IV. If return statement is omitted, and then the function does its job but
returns no value to the calling environment.

A. I and II
B. I and III
C. II and III
D. II and IV

94 Every C programme should contain ________function.

a) printf()
b) show() CO4.2 k1
c) scanf()
d) main()

95 The minimum number of functions that must be present in a C program is _____

a) 1
b) 2 CO4.2 K1
c) 3
d) 4

96 _____characters are allowed in a C function name identifier.

a)Alphabets, Numbers, %, $, _

b)Alphabets, Numbers, Underscore ( _ ) C04.1 K1

c)Alphabets, Numbers, dollar $


d)Alphabets, Numbers, %

97 Arguments received by a function in the C language are called ___


arguments

CO4.1 K1
a) Definite arguments
b) Formal arguments
c) Actual arguments
d) Ideal arguments

98 Select a non-Library C function from the list below.  CO4.1 K2


a) printf()
b) scanf()
c) fprintf()
d) printf4()

99 Choose the best one - prior to using a pointer variable

A. It should be declared.
CO4.1 K1
B. It should be initialized
C. It should be both declared and initialized.
D. None of the above.
100 Forward declaration is absolutely necessary

A. If a function returns a non-integer quantity


B. If the function call precedes its definition
C. If the function call precedes its definition and the function returns a CO4.2 K1
non integer quantity
D. None of the above

101 The reason for using pointers in a C program is

A. Pointers allow different functions to share and modify their local


variables.
B. To pass large structures so that complete copy of the structure can be
avoided. CO4.6 K1
C. Pointers enable complex "linked" data structures like linked lists and
binary trees.
D. All of the above

102  How can you write a[i][j][k][l] in equivalent pointer expression?

A. (((***(a+i)+j)+k)+l)
B. ((**(*(a+i)+j)+k)+l)
CO4.6 K2
C. (*(*(*(a+i)+j)+k)+l)
D. *(*(*(*(a+i)+j)+k)+l)

103 In order to fetch the address of the variable we write preceding CO4.3 K2
_________ sign before variable name.

A. Percent(%)
B. Comma(,)
C. Ampersand(&)
D. Asteric(*)

104 Comment on this constint *ptr;

A. You cannot change the value pointed by ptr


B. You cannot change the pointer ptr itself
CO4.5 K1
C. Both (a) and (b)
D. You can change the pointer as well as the value pointed by it

105 Choose the best one - prior to using a pointer variable

A. It should be declared.
B. It should be initialized
CO4.6 K2
C. It should be both declared and initialized.
D. None of the above

106 The pointer ptr points to which string?

char *ptr;

char myString[]="letsfind";

ptr=myString
CO4.6 K3
ptr+=5;

A. find
B. ind
C. letsf

D.f
107 Which of the following statements correct about k used in the below CO4.6 K2
statement?
char ****k;

A. k is a pointer to a pointer to a pointer to a char


B. k is a pointer to a pointer to a pointer to a pointer to a char
C. k is a pointer to a char pointer
D. k is a pointer to a pointer to a char

108
Which of the following operators can be applied to CO5. K1

structure variables? 1

a. Equality comparison ( == )

 b. Assignment ( = )

c. Both of the above


109
What is the similarity between a structure, a union, and an CO5. K2

enumeration? 2

a. All of them let you define new values

b. All of them let you define new data types

c. All of them let you define new pointers

d. All of them let you define new structures


110
Which of the following are themselves collections of CO5. K2

different data types? 2

a. String
b. Structure

c. Char

d. All of the mentioned


111
A user-defined data type can be derived by _______. CO5. K1

2
a. struct

b. enum

c. typedef

d. All of the mentioned


112
Which operator connects the structure name to its member CO5. K2

name? 3

a. -

b. .

c. Both (b) and (c)


113
Which of the following cannot be a member of a CO5. K2

structure? 3

a. Another structure

b. Function
c. Array

d. None of the mentioned


114
Which of the following structure declarations will throw CO5. K2

an error? 3

a. struct temp{}s;

main(){}

b. struct temp{};

struct temp s;

main(){}

c. struct temp s;

struct temp{};

main(){}
115
What is the output of this C code? CO5. K2

void main()

struct student

{
int no;

char name[20];

};

struct student s;

s.no = 8;

printf("%d", s.no);

a. Nothing

b. Compile time error

c. Junk

d. None of the mentioned


116
What is the number of bytes in memory taken by the CO5. K3

below structure? 4

struct test

int k;

char c;

};

a. Multiple of integer size


b. integer size + character size

c. Depends on the platform

d. Multiple of word size


117
The size of a union is determined by the size of the CO5. K2

6
a. First member in the union

b. Last member in the union

c. Biggest member in the union

d. Sum of the sizes of all members


118
What would be the size of the following union CO5. K3

declaration? 6

union uTemp

double a;

int b[10];

char c;

}u;

(Assuming size of double = 8, size of int = 4, size of char

= 1)

a. 4

b. 8
c. 40

d. 80
119
Members of a union are referred to as: CO5. K1

7
a. union-name.member

b. union-pointer->member

c. Both a & b

d. None of the mentioned


120
Which of the following share a similarity in syntax? CO5. K1

7
1.Union, 2. Structure, 3. Arrays and 4. Pointers

a. 3 and 4

b. 1 and 2

c. 1 and 3

d. 1, 3 and 4
121
Which of the following data types are accepted while CO5. K1

declaring bit-fields? 4

a. char

b. float

c. double
d. None of the mentioned
122
Which is not a storage class? CO5. K3

a. Auto

b. Struct

c. Typedef

d. Static
123
In the declaration of bit-fields, CO5. K2

struct-declarator: 7

declarator

type-specifierdeclarator opt : constant-expression

The constant-expression specifies

a. The width of the field in bits.

b. Nothing

c. The width of the field in bytes.

d. Error
124
In the event of a name conflict between a local and global CO5. K2

variable, what happens? 8

a) The global variable is given a priority.


b) The local variable is given a priority.

c) Which one will get a priority depends upon which one

is defined first.

d) The compiler reports an error.


125
Bit fields can only be declared as part of a structure. CO5. K1

a. false

b. true

c. Nothing

d. Varies
126
Where will the space be allocated for an automatic storage CO5. K2

class variable? 8

a) In CPU register

b) In memory as well as in CPU register

c) In memory

d) On disk.
127
Which of the following statements about the usage of CO5. K2

structures is true? 7

a. Union is a structure whose members share same


memory area

b. The compiler will keep track of what type of

information is currently stored

c. Only one of the members of union can be assigned a

value at particular time

d. Size allocated for Union is the size of its member

needing the maximum storage


128
What is the another name for .C file.? CO5. K1

a. Executable code

b. Source Code

c. Distributable Code

d. Macro code

129
What are the types of C pre-processor directives? CO5. K2

9
a. Macros

b. Conditional Compilation

c. File Inclusion

d. All the above


PART -B
1 What are the main characteristics of third generation of computers? CO1.1 K
2
2 Enumerate the generation of computer. CO1.1 K
1
3 Classify the computer system according to their purpose. CO1.1 K
2
4 Write short note on memory unit in CPU. CO1.1 K
2
5 What is the value of 163 in binary? C01.4 K
3
6 Convert given binary number into decimal? CO1.5 K
(i)10000101010 3
(ii) 101111.1101

7 Transform given binary number into octal? CO1.5 K


1. 1101000001 3
2. 111001010111

8 Convert the given binary number into hexadecimal? CO1.5 K


1. 101111111111000000 3
2. 101010101010111

9 Write a pseudo code that reads two numbers and multiplies them CO1.7 K
together and print out their product. 3
10 Draft a pseudo code to print all multiples of 5 between 1 and 100 CO1.7 K
(including both 1 and 100). 3
11 Give the advantages and disadvantages of flow chart. CO1.8 K
2
12 Mention the steps involved in logical analysis and thinking CO1.6 K
methodology. 2
13 Describe the algorithmic approach to programming. CO1.6 K
2
14 Explain the control unit functions. CO1.2 K
2
15 Significance the function of CPU in the computer system. CO1.2 K
2
16 What are the steps involved problem solving in c program? CO2.1 K
2
17 Difference identifier and keywords in c. CO2.4 K
2
18 Define syntax in 'C'. CO2.2 K
2
19 Make brief notes about the main function() in the C program. CO2.3 K
2
20 What are the types of I/O statements available in ‘C’? CO2.7 K
2
21 What are the types of looping statements available in C CO2.8 K
2
22 Mention the various Decisions making statement available in C. CO2 K
.8 2
23 Distinguish between while and do-while statement in C. CO2.8 K
2
24 Define Compilation process. CO2.4 K
2
25 What do you meant by linking? CO2.4 K
2
26 Create a C program to check whether a number is prime or not CO2.9 K
3
27 Differentiate between formatted and unformatted you input and output functions? CO2.7 K
2
28 Briefly elaborate on the various control statement CO2.11 K
2
29 Describe the different types of operators used in C with the required program CO2.7 K
3
30 Show the different kinds of data in c CO2.6 K
2
31 Draw the structure of C program C02.3 K
2
32 Write the rules of C program. CO2.3 K
2
33 What are the data types used in C program? CO2.5 K
2
34 Draft a program to initialize array values as 10,20,30,40,50 CO3.1 K
2
35 Write a program to find average marks obtained by a class of 30 students in list. CO3.1 K
1
36 Point out the errors, if any, in the following program segments: CO3.2 K
# include <stdio.h> 3
int char mixed[ 100 ] ;
int main( )
{
int a[ 10 ], i ;
for ( i = 1 ; i<= 10 ; i++ )
{
scanf ( "%d", a[ i ] ) ;
printf ( "%d \ n", a[ i ] ) ;
}
return 0 ;
}
37 Difference between char array and string array. CO3.2 K
2
38 Describe the following with suitable examples. CO3.3 K
2
(i) Initializing a 2 Dimensional Array

(ii) Memory Map of a Dimensional Array

39 Point out the errors, if any, in the following programs: C03.3 K


2
# include

int main( )

Inttwod[ ][ ]={

2,4,

6,8

};

Printf(“%d\n”,twod);

Return 0;

40 Write any two types of string function CO3.3 K


1
41 Describe the string operations. CO3.4 K
1
42 Give short notes on Reading and Writing string CO3.4 K
2
43 Define Contiguous Memory. CO3.5 K
2
44 Draw a program to store string array names and need to exchange 2nd and 4th CO3.5 K
the position of the names. 3
45 Point out the errors, if any, in the following programs: CO3.5 K
3
# include<stdio.h>

# include<string.h>

Int main()

{char*str1=”united”;
Char *str2=”front”;

Char*str3;

Str3=strcat(str1,str2);

Printf(“%s\n”,str3);

Return 0;

46 write a program that will read a line and delete from it all occurrences of the word CO3.6 K
'the' 3

47 Draft a program that converts a string like "124" to an integer 124 CO3.6 K
3
48 Write a program to pick up the largest number from any 5 row by 5 column CO3.9 K
matrix. 3

49 Describe pointers and the operations that can be performed on them. CO4.4 K
2

50 Explain the various categories of user defined functions in C with examples? CO4.1 K
2
51 Print out the errors, if any, in the following programs: CO4.3 K
2
#include<stdio.h>

Intaddmult( int, int)

Int main()

Inti=3,j=4,k,l;

k=addmult(i,j);

l=addmult(i,j);

printf(“%d%d\n”,k,l);

return 0;

}
Intaddmult( int ii, intjj)

Intkk,ll;

Kk=ii+jj;

Ll=ii*jj;

Return (kk,ll);

}
52 Write a C function using pointers to exchange the values stored in two CO4.4 K
locations in the memory 3
53 Write a program for pointer to void? CO4.1 K
3
54 Explain the use of the fflush() function. CO4.2 K
1
55 Distinguish between malloc() and calloc(). CO4.2 K
2
56 How many arguments can be used in a function? CO4.6 K
2
57 Write a recursive function to obtain the running sum of first 25 natural CO4.1 K
numbers. 3
58 Write a function that receives 5 integers and returns the sum, average and CO4.2 K
standard deviation of these numbers. Call this function from main( ) and print 3
the results in main( ).
59 Define pointers arithmetic. CO4.6 K
1
60 Differentiate actual parameters and formal parameters. CO4.5 K
3
61 Draft a program to find factorial of a number using recursion. CO4.4 K
3
62 Write a program to calculate GCD of two numbers using recursion CO4.3 K
3
63 Write a program to generate Fibonacci series using recursive functions. CO4.4
K
3
64
Compare structures and unions. CO5. K

5 2
65
Define structure in C. CO5. K

1 1
66
How to declare a structure member CO5. K

3 2

67
How to define a union in C CO5. K

5 2
68
How can you access the members of the union? CO5. K

6 2
69
What are the pre-processor directives? CO5. K

9 1
70
What are storage classes? CO5. K

8 1
71
What is the static storage class? CO5. K

8 2
72
What are conditional inclusions in the pre-processor CO5. K

directive? 9 2
73
Describe structure within structure function? CO5. K

4 1
74
Mention the need for structure data type C. CO5. K

2 1
PART –C
1 Convert the following binary numbers into decimal ,octal and CO1.5 K
hexadecimal numbers 3
(i)10111010101
(ii) 1011111101
(iii)10000111010101
(iv) 10000100101
2 Transform the followingnumbers system CO1.5 K
a) Decimalto binary 3
(i) 75
(ii) 1412
(iii)25.75
(iv)32
b)Decimal to octal
(i) 175.25
(ii) 1246
(iii) 46
(iv) 23
c)Decimal to hexadecimal
(i) 479
(ii) 510
(iii) 4584
(iv)352000
3 Draft the different blocks of flowchart and elaborate its functions. CO1.8 K
2
4 Explain in detail about generations and classification of computer. CO1.1 K
2
5 Distinguish between algorithm and pseudo code. CO1.7 K
2
6 Elaborate rules for correcting efficient algorithm. CO1.6 K
1
7 Describe the steps involved in binary number to octal and hexadecimal C01.5 K
number conversion system with an example. 3

8 Write pseudo code that will perform the following. CO1.7 K


a) Read in five separate numbers. 4
b) Calculate the average of the five numbers.
c) Find the smallest (minimum) and largest (maximum) of the five
entered numbers.
d) Write out the results found from steps b and c with a message
describing what they are.
9 Discuss the elements of modern computers. CO1.2 K
2
10 Draw a flowchart along with algorithm to convert the length in feet to CO1.8 K
centimetre. 4
11 Transform to number system CO1.4 K
a. )hexadecimal to binary 3
(i) A9
(ii) AFCG
b.)hexadecimal to octal
(i) AC
(ii) 1EF
c.)hexadecimalto decimal
(i)23E
(ii) 4B7
A School with 600 students wants to produce some information from C01.7 K
the results of the four standard tests in Maths, Science, English and IT. 5
Each test is out of 100 marks. The information should be the highest,
12 lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.) write a pseudocode to complete above task.
13 A School with 600 students wants to produce some information from CO1.6 K
the results of the four standard tests in Maths, Science, English and IT. & 6
Each test is out of 100 marks. The information should be the highest, CO1.7
lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.By your own instructions, write an algorithm to complete the same task.

14 A School with 600 students wants to produce some information from CO1.8 K
the results of the four standard tests in Maths, Science, English and IT. 6
Each test is out of 100 marks. The information should be the highest,
lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.) Draw a flowchart for above mentioned task.
15 A School with 600 students wants to produce some information from CO1.6 K
the results of the four standard tests in Maths, Science, English and IT. 6
Each test is out of 100 marks. The information should be the highest,
lowest and average mark for each test and the highest, lowest and
average mark overall. All the marks need to be input.
a.) Draft an algorithm with reduce the number of students to 5 and the
number of subjects
to 2
16 Tickets are sold for a concert at $20 each. If 10 tickets are bought CO1.8 K
together,then the discount 10%. If 20 tickets are bought together, then 6
the discount is 20%. No more than 25 tickets can be bought in a single
transaction

a) Draw a flowchart for the algorithm to calculate the cost of buying a


given number of tickets.
17 What is problem formulation and problem solving CO2.1 K
2
18 Discuss in detail about structure of c program. CO2.3 K
2
19 Define character set and its types. CO2.4 K
2
20 Explain in detail about constants CO2.5 K
2
21 Illustrate variables and its types with an example. CO2..5 K
2
22 Provide a detailed example of the structure if a c program. CO2.3 K
2
23 Explain in detail about the constants, expressions and statements in ‘C’. CO2.5 K
3
24 Evaluate the following expression A=2+3*4/6%2-2. CO2.6 K
C=4*9%3+5*2-1. 3
D=1+5*8/4-4*6.
E=4+5*2/1-1
25 Draft a C program to find roots of a quadratic equation. CO2.9 K
3
26 Discuss about the expressions and statements in C. CO2.6 K
2
27 Draft a schedule C to verify if a particular year is a leap year or not. CO2.6 K
3
28 Illustrate about decision making and branching statements with an example CO2.7 K
2
29 Explain in detail the operation of various looping statements in c with suitable CO2.8 K
2
30 Write a C program to find the sum of all odd / even numbers between 1 and 100 CO2.9 K
3
31 Check whether a given number is a palindrome (232) or not with a suitable example. CO2.9 K
3
32 Write a C program to generate the first n numbers in a Fibonacci series CO2. K
9 3
33 Draft a C program to find the sum of 10 non-negative numbers entered by the user. CO2.9 K
3
34 A Crowdsourced Potato Chip
In an effort to increase sales among millennials, PepsiCo turned to crowd
sourcing to get new flavor ideas for their Lay’s potato chips (called Walker’s in
the UK). Their 2012 campaign, “Do Us a Flavor,” was so successful that they
received over 14 million submissions. The winner was Cheesy Garlic Bread,
which increased their potato chip sales by 8 percent during the first three months
after the launch. CO2.1 K
What are some other products that would work well for a crowd sourced 4
campaign contest?
What items wouldn’t work well?

35 Draft programs for the following CO2.9 K


a.) To find out whether a triangle can be formed with three positive integers 3
supplied
b.)To find out whether a triangle is right-angled or not
36 Create a C program to calculate mean and median for an array of elements. CO3.1 K
3
37 Draw a C program to re-order a one-dimensional array of numbers in descending CO3.2 K
order. 3
38 Describe the following functions with examples. CO3.3 K
2
(i) strlen()

(ii) strcpy()

(iii)strcat()

(iv)strcmp()

39 Explain about the string Input/ Output functions with example? CO3.4 K
3
40 Write a C program to find average marks obtained by a of 30 students in a test. CO3.4 K
3
41 Explain about the following : CO3.5 K
2
(i).String and character array.

(ii).Initializing a string variables.

(iii).String input and output

42 Develop a C program to search an element from the array. CO3.7 K


3
43 Elaborate binary search algorithm with an example program CO3.7 K
3
44 To uniquely identify a book a 10-digit ISBN (International Standard Book CO3.7 K
Number) is used. The rightmost digit is a checksum digit. This digit is determined 4
from the other 9 digits using the condition that d1+2,d2+3,d3+.....+10d10 must be
a multiple of 11 ( where di denotes the ith digit from the right). The checksum
digit d1 can be any value from 0 to 10: the ISBN convention is to use the value X
to denote 10.

Write a program that receives a 10-digit integer, computes the checksum, and
reports whether the ISBN number is correct or not
45 Develop a C program to search an element from the array. CO3.7 K
3
46 Elaborate binary search algorithm with an example program CO3.7 K
3
47 Draft a c program to multiply two matrices (two dimensional array). CO3.8 K
3
48 Write a C program to perform the following matrix operations: CO3.8 K
3
(i) Addition (ii) subtraction

49 Draft a program to swap numbers in cyclic order using Call by Reference CO4.3 K
3
50 Create a program in C to add numbers using call-by-reference. CO4.3 K
3
51 Find the maximum number between two numbers with a suitable C program CO4.8 K
code. 3
52 Develop a program in C to calculate the length of the string using a pointer. CO4.8 K
3
53 Write a program in C to find the square of any number using the function. CO4.8 K
3
54 Convert a decimal number to a binary number using the function in a suitable CO4.2 K
c program. 3
55 Check Armstrong and perfect numbers with the function and the appropriate CO4.8 K
C program code. 3
56 Explain recursion in detail with a C program. CO4.4 K
2
57 Illustrate the following CO4.3 K
(i) Call by value 2
(ii) Call by reference

58
Explain the structures within examples. C K

O 2

2
59
Write a C programme using structures to prepare the CO5. K

students' mark statements. 3 3


60
Draft a C programme using structures to prepare the C

employee payroll of a company using storage classes. O K

5 3

8
61
Describe in detail the pre-processors in C. C K

O 2

9
62
What are storage classes? Explain each with an example. C K

O 2

8
63
How can you insert structure into another structure? C K

O 2

6
64
Define Union. How can a structure be made to function in C? CO5. K
5 2
65
Create a database of employees with the following data: CO5. K

Empno 2 4

Name

Basic(pay)

Grade

Get the data and arrange the records on the basis of their

names.

write programs for the following

A menu based bank account management software.

1.opening account

2.deleting account

3.deposit

4.withdrawal

5.printing summary of accounts-total balance at the end of

the day

You might also like