Here are the multiple-choice questions (MCQs) with the answers provided:
Unity English Medium School, Ankleshwar
Date: 07-12-2024
STD: 10 Computer
Total Marks: 25
Third Unit Test
Time: 1 Hour
Choose the right answer. [25]
- _______ means simulated code.
(A) Pseudo code (Answer)
(B) Flow chart
(C) Algorithm
(D) None of the given - Which of the following is a pictorial representation of a problem-solving technique?
(A) Pseudo code
(B) Flow chart (Answer)
(C) Algorithm
(D) Computer program - Which of the following is used to distinguish different connector pairs in a chart?
(A) Arrows are used
(B) Alphabets or other characters are used
(C) Circles are used (Answer)
(D) Diamonds are used - In which of the following symbols, the variable is assigned the value or the output is displayed?
(A) Oval
(B) Diamond
(C) Rectangle
(D) Parallelogram (Answer) - In which symbol is the statement “Print B” written?
(A) Oval
(B) Rectangle
(C) Parallelogram (Answer)
(D) Circle - The function ________ is used for calculating the value of X raised to a given power.
(A) pow( ) (Answer)
(B) expo( )
(C) sqr( )
(D) none of the given - C language was derived from _______.
(A) BCPL (Answer)
(B) ICPL
(C) IPCL
(D) SGML - The
<stdio.h>
file contains information about the _______
(A) user-defined functions
(B) in-built functions used in the program (Answer)
(C) symbolic constant
(D) variable - Each C program starts with _________ statement.
(A) #define PI 3.14
(B) #include <stdio.h> (Answer)
(C) Include <>
(D) none of the given - C variables are governed by ________.
(A) type
(B) name
(C) scope
(D) all of the given (Answer) - _______ of the following functions provides a normal exit from the main or any other function.
(A) scanf( )
(B) return 0 (Answer)
(C) printf( )
(D) end main - The data having no void value is known as _______.
(A) Null
(B) Nill
(C) Empty (Answer)
(D) Dull - The type of value that can be assigned to an identifier is known as its _______.
(A) constant
(B) variable
(C) data type (Answer)
(D) array - Which of the following keywords refer to the integer data type?
(A) Integer
(B) Integer
(C) INTEGER
(D) int (Answer) - unsigned int has a range of _______.
(A) (-32767 to +32768)
(B) (0 to 4294967295) (Answer)
(C) (0 to 2147483647)
(D) (-2147483648 to +2147483647) - Float data types are precise at times _______ decimal digits, i.e., before the ‘.’.
(A) 6 (Answer)
(B) 5
(C) 4
(D) 7 - The increased range of double numbers _______ is used as a prefix to double.
(A) unsigned
(B) long (Answer)
(C) wide
(D) twice - Keyword
char
occupies ______ byte of memory space.
(A) 4
(B) 2
(C) 1 (Answer)
(D) 3 - What will be the value of variables a, b, and c if
a 75.5 21
is given as input forscanf(‘%c %d %d’, &a, &b, &c);
?
(A) ‘a’ 75.5
(B) ‘a’ 21
(C) ‘a’ 75 5 (Answer)
(D) ‘a’ 75 21 - Which of the following files contains various input and output operations related functions?
(A) math.h
(B) stdio.h (Answer)
(C) conio.h
(D) string.h - Which of the following functions is more appropriate for accepting a string?
(A) getch( )
(B) gets( ) (Answer)
(C) getchar( )
(D) getc( ) - In
scanf( )
statement, the general format of the control string is _______.
(A) / Ip
(B) +lp
(C) %ip (Answer)
(D) -Ip - _______ format specifier in
scanf( )
reads a short integer.
(A) %h (Answer)
(B) %u
(C) %g
(D) %ld %lf
format specifier inscanf( )
reads a ______.
(A) long integer
(B) long double real number
(C) double real number (Answer)
(D) real number%s
format specifier inscanf( )
reads a ______.
(A) character
(B) string (Answer)
(C) short integer
(D) long integer
- Which of the following is the correct syntax to declare a constant in C?
(A) const int x;
(B) int const x;
(C) const x;
(D) Both (A) and (B) (Answer) - What is the output of the following code?
printf("%d", 10/4);
(A) 2.5
(B) 2 (Answer)
(C) 2.0
(D) Error
- In C, which of the following is used to read a character from the user?
(A) scanf(“%d”, &x);
(B) scanf(“%c”, &x); (Answer)
(C) getch();
(D) getchar(); - Which of the following is a logical operator in C?
(A) ==
(B) && (Answer)
(C) <
(D) = - Which of the following functions is used to find the length of a string in C?
(A) strlen() (Answer)
(B) strlength()
(C) size()
(D) length() - What is the size of
int
in most systems?
(A) 2 bytes
(B) 4 bytes (Answer)
(C) 8 bytes
(D) Depends on the compiler - What is the output of the following code?
int a = 5;
a++;
printf("%d", a);
(A) 5
(B) 6 (Answer)
(C) 4
(D) Error
- Which of the following statements is true about arrays in C?
(A) An array can store values of different data types.
(B) Arrays are always passed by reference to functions.
(C) The index of an array starts from 1.
(D) Arrays in C have a fixed size. (Answer) - What is the purpose of the
return
statement in C?
(A) To exit from a loop
(B) To exit from a function (Answer)
(C) To print a value
(D) None of the above - What is the correct syntax to define a structure in C?
(A) struct { int x; } myStruct; (Answer)
(B) struct myStruct { int x; };
(C) myStruct struct { int x; };
(D) struct myStruct { int x; } - Which of the following is used to allocate memory dynamically in C?
(A) malloc() (Answer)
(B) free()
(C) new
(D) delete - Which of the following operators is used for the bitwise AND operation in C?
(A) &&
(B) & (Answer)
(C) |
(D) ^ - What is the default value of an uninitialized local variable in C?
(A) 0
(B) Garbage value (Answer)
(C) NULL
(D) Undefined - Which of the following is used to declare a pointer in C?
(A) int *p; (Answer)
(B) int p;
(C) int p;
(D) None of the above - What will be the output of the following code?
int x = 10; printf("%d", ++x);
(A) 9
(B) 10
(C) 11 (Answer)
(D) Error - Which function is used to read a string from the user in C?
(A) getch()
(B) gets() (Answer)
(C) putchar()
(D) getchar() - In C, a loop that runs indefinitely is called a ________ loop.
(A) Infinite (Answer)
(B) While
(C) Do-While
(D) For - Which of the following is used to break out of a loop in C?
(A) continue
(B) break (Answer)
(C) return
(D) exit - Which of the following statements is used to include a standard input/output library in C?
(A) #include <stdio.h> (Answer)
(B) #include “stdio.h”
(C) #include <inputoutput.h>
(D) #include “inputoutput.h” - In C, which of the following functions is used to compare two strings?
(A) compare()
(B) strcompare()
(C) strcmp() (Answer)
(D) strcmpi() - What will be the output of the following code?
int a = 10, b = 20; printf("%d", a > b ? a : b);
(A) 10
(B) 20 (Answer)
(C) Error
(D) None of the above - Which of the following is used to store a fixed-size sequence of characters in C?
(A) Array
(B) String (Answer)
(C) Linked list
(D) Structure - What does the
sizeof()
function do in C?
(A) Returns the length of a variable or data type (Answer)
(B) Returns the address of a variable
(C) Allocates memory dynamically
(D) None of the above - Which of the following data types is used to store floating-point numbers in C?
(A) float (Answer)
(B) int
(C) char
(D) double - Which of the following is a correct way to declare an array of 5 integers in C?
(A) int arr[5]; (Answer)
(B) int[5] arr;
(C) int arr(5);
(D) array int[5];