[go: up one dir, main page]

0% found this document useful (0 votes)
2 views2 pages

Unit7 Maths

The document consists of a series of multiple-choice questions related to C and C++ programming concepts, including header files, functions, arrays, structures, and data types. Each question presents four options, with the goal of testing knowledge on programming syntax and functionality. The questions cover a range of topics, from basic syntax to more complex concepts in programming.

Uploaded by

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

Unit7 Maths

The document consists of a series of multiple-choice questions related to C and C++ programming concepts, including header files, functions, arrays, structures, and data types. Each question presents four options, with the goal of testing knowledge on programming syntax and functionality. The questions cover a range of topics, from basic syntax to more complex concepts in programming.

Uploaded by

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

1. Which header file defines the function puts()?

(a) stdio.h (b) ctype.h (c) conio.h (d) manip.h


2. Which of the following function does not return 1?
(a) isupper () (b) toupper() (c) islower() (d) isdigit()
3. Which of the following headerfile used to define sin() function?
(a) ctype.h (b) stdlib.h (c) math.h (d) string.h
4. The keyword used to declared a constant variable is?
(a) constant (b) void (c) const (d) constkey
5. Which of the following doesn't take two arguments?
(a) strcat () (b) strcpy () (c) strcmp() (d) strlwrc ()
6. A variable declared above all blocks and functions and main ()function has the scope______
(a) file (b) function (c) class (d) local
7. The cos() function returns the value in the range of_____
(a) [0 1] (b) [1 2] (c) [-1 1] (d) [-10 10]
8. srand() and rand() belong to the header file____
(a) math.h (b) cstdlib.h (c) string.h (d) rand.h
9. The parameters used in the function definition are known as____
(a) actual (b) formal (c) main (d) built-in
10. The functions that return to value is declared as_____.
(a) inline (b) return (c) stack (d) void
11. cin>>n[4]; to which element does the statement accept the value?
(a) 4 (b) 2 (c) 5 (d) 3
12. Which keyword is used to create structures in C++?
(a) struct (b) strcture (c) void (d) const
13.int age[]={6,80,75,21,10};How many elements are there in this array?
(a) struct (b) strcture (c) void (d) const
14. Array subscripts always starts with which number?
(a) -1 (b) 0 (c) 2 (d) 3
15. Which of the following is the collection of variables of the same type that can
referenced by a common name?
(a) int (b) float (c) Array (d) class
16.int age[]={6,90,20,18,2};How many elements are there in this array?
(a) 2 (b) 5 (c) 6 (d) 4
17. cin>>n[3];To which element does this statement accept the value?
(a) 2 (b) 3 (c) 4 (d) 5
18. By default, a string ends with which character?
(a) 10 (b) \t (c) \n (d) \b
19. Structure definition is terminated by
(a) : (b) } (c) ; (d) :
20. What will happen when the structure is declared?
(a) it will not allocate any memory (b) it will allocate the memory
(c) it will be declare and initialize (d)it will be only declared
21. A structure declaration is given Using below declaration which of the following refers to
seconds. struct Time{
(a) Time.seconds (b) Time::seconds (c) seconds(d) t.seconds int hours,minutes,seconds;};
22. Which of the following is a properly defined structure?
(a) struct {int num;} b) struct sum {int num;}c) struct sum int sum; d) struct sum {intnum;};
23. A strcture declaration is given below.
struct employee{
int empno;
char ename[10];}e[5]; Using above declaration which of the following statement is correct
(a) cout<<e[0].empno<<e[0].ename; (b) cout<<e[0].empno<<ename
(c) cout<<e[0]->empno<<e[0]->ename (d) cout<<e.empno<<e.ename;
24. When accessing a structure member, the identifier to the left of the dot operator is the
name of
(a) structure variable (b) structure tag (c) structure member (d) structure function
25.Which of the following concept helps to store multiple values in a single variable?
(a) function (b) Array (c) overloading (d) abstraction
26.Which of the following is a derived datatype?
(a) Array (b) structure (c) void (d) both a and b
27.How many tyes of arrays in C++?
(a)2 (b)3 (c)4 (d) many
28.In which array the values are arranged in a single row?
(a)2D (b) Multi Dimensional (c) 1D (d)5D
29. Which of the following is a correct syntax?
(a)<datatype> [array size] <array name>; (b) <datatype><array name>[array size];
(c) <array name> [arraysize] [datatype]; (d) [datatype] <array name> <array size>;
30. How many bytes allocated to int datatype by Turbo C++?
(a)2 (b)4 (c)8 (d)10

You might also like