You are on page 1of 8

Who is father of C Language?

DENNIS RITCHIE

Who was Creator of B Language, which inspired Dennis Ritchie to create Strong Procedural Language
called C?
KEN THOMPSON

Low level language is.?


LOOKS LIKE RAW DATA OFTEN IN THE FORM OF I'S AND O'S.

Assembly language is converted to machine language with the help of


ASSEMBLER

C programs are converted into machine language with the help of


Compiler

What of the following is true?


Variables are used to store values

Valid C programming language variable


_age

---------_ are the entities whose values can be changed


Variables

Variables in the C program can't start with


Both a and b are correct.
a. Special characters except for the underscore
May be
b. Numbers

A variable in c
must have a name starting with a character
can't have a name same as keyword
All of above
must have a valid datatype

Refers to functions or procedures that perform a specific task or set of tasks and can be called from
other parts of the program.
SUBPROGRAM SECTION

declaration refers to the declaration of a variable or function that is accessible from any part of the
program, not just from the block or function where it was declared.
GLOBAL SECTION
#include <stdio.h>
int main()
int main = 3;
printf("%d", main);
return O;
COMPILE TIME ERROR

++ is a_____ operator.
UNARY

*_________is a operator
BINARY

&& is a __________operator
LOGICAL

________is a type specifier of double.


%lf

Choose the right statement.


int a = 10 + 4.867;
14

#include<stdio.h>
Int main()
{
double x=1.2;
int sum = (int) x + 1;
printf(“”sum= %d””, sum);
return 0;
}
SUM = 2

What is the Format specifier used to print a String


%S

What is a format specifier in C language


a) Different format specifiers are used to print different type of data
b) A format Specifier tells compiler to treat a variable value is predefined way.
c) Format specifiers are used to write data to files in a formatted way.
ALL THE ABOVE

The first expression in a for ……loop is


INITIALIZATION
Decision Control Statement in C can be implemented using
if -else, if
conditional operator
ALL

If block always need to be associated with a else block?


FALSE

Which of the following decision-making statements is used to execute a block of code only if the
condition is true.
IF

Which of the following cannot be checked in a switch-case statement.


FLOAT

Which are not looping structures?


IF

In C, what is the purpose of the "goto" statement


TO TRANSFER CONTROL TO A LABELLED STATEMENT WITHIN THE SAME FUNCTION.

Which one of following is an exit-controlled loop?


DO WHILE

What is the purpose of the "break" statement in C


TO EXIT FROM A LOOP OR SWITCH STATEMENT

When there is a need to skip the remaining code of the current iteration, which keyword is useful in
C.
CONTINUE

Which C reserved keyword is used to come out of the loop


BREAK

The main purpose of function is to save typing time.


TRUE

What is the limit for number of functions in a C Program?


NO LIMIT

Which of the following functions is already declared in the "header file"?


Built-in function

Choose correct statement about Functions in C Language.


a) A Function is a group of c statements which can be reused any number of times
b) Every Function has a return type
c)Every Function may no may not return a value d) All the above
ALL ARE TRUE.
What are the types of functions in C Language
BOTH LIBRARY AND USER DEFINED FUNCTION
How many times the program will print "Hello"
int main() {
printf("Hello");
main();
return O;
TILL STACK OVERFLOW

Arguments passed to a function in C language are called ____arguments.


ACTUAL ARGUMENTS and receiving the argument is FORMAL ARGUMENTS.

What is the minimum number of functions to be present in a C Program


ATLEASE 1 WHICH IS MAIN FUNCTION

The keyword used to transfer control from a function back to the calling function is.
RETURN

_____ class refers to the persistence of a variable and its scope within the program, that is, the
portion of the program over which the variable is recognized.
STORAGE

The variables declared in the main() function are the global variables.
FALSE

The global variables are more secured than the automatic variables in a program.
FALSE

The key word auto is must in the declaration of automatic variables.


FALSE

Does an automatic variable retain its value once control iS transferred out of its defining function?
NO

default value of auto variable


GARBAGE

By default, a Static variable is initialized to


0

Visibility provides security for your data used in a program.


TRUE
The visibility of a variable determines how much of the rest of the program can access that variable.
TRUE

How do you pass an array to a function in C?


BY PASSING ARRAY NAME
How do you declare an array named "scores" that can store 5 integers in C
INT SCORES[5];

What is the starting index of an array in C?


0

What is the maximum number of dimensions an array in C may have?


THEORETICALLY NO LIMIT. THE ONLY PRACTICAL LIMITS ARE MEMORY SIZE AND COMPILERS.

What is the correct way to declare a string in C


char name[];

What is the correct way to compare two strings in C.


STRCMP()

Which function is used to copy one String to another in C


STRCPY()

How are arrays and strings related in C.


STRINGS ARE A SPECIFIC USE CASE OF CHARACTER ARRAYS.

Which function is used to concatenate two strings in C


STRCAT()

Which character is used to represent the end of a string in C


/0

What is the primary difference between an array and a string in C


Arrays can store any data type, while strings specifically store characters.

Which library is used for string manipulation functions in C


STRING.H

What function is used to find the length of a string in C


STRIEN()

What is the purpose of the null character ('\O') in C strings.


It signifies the end of the string.

Dereference operator is also known as……….


Indirection operator

reference operator is……….


&

Which is an indirection operator among the following?


*
The default parameter passing mechanism is
Call by value

For an int array a[10], If you declare a pointer variable ip then you can set it to point to the beginning
of an array by assigning: int *ip = ………………
&a[0]

Is example of double pointer….


**p

Correct the below statements:


int a, b;
b=&a
int a, *b:
b=&a

What is wild pointer in c ____.


a point which has not initialized

Which of the following is NOT a pointer variable declaration


float height[];

can stored the address of any types of data.


Generic pointer

int *ptr, p;
ptr is a pointer to integer, p is not
Assign the null value is called
NULL POINTER

Is the NULL pointer same as an uninitialized pointer


FALSE

If a pointer variable points another pointer value known as_


pointer to pointer

struct student
{
};
void main()
{
struct student s[2];
printf("%d" sizeof(s));
0 Answer

Which of the following is not a preprocessor directive?


File handling
C preprocessor is conceptually the first step during compilation.
TRUE

Memory allocation using malloc() is done in?


HEAP AREA

void *malloc(size_t n) returns


Pointer to n bytes of uninitialized storage

In function p is a
Pointer returned by malloc() & calloc()

Which one is used during memory deallocation in C?


FREE(P);

Which of the following is static memory allocation


ARRAY

Which header file is mandatory for DYNAMIC MEMORY ALLOCATION


stdlib.h

What is correct about calloc() function?


1. If the space is insufficient then NULL pointers.
2. initialize the elements to O
3. Allocates the space for elements of an ARRAY
ALL of these

calloc and malloc function is used for


DYNAMIC MEMORY ALLOCATION.

Select a function which is used to write a string to a file.


Fputs()

The type FILE is predefined in the header file


stdio.h

Which of the following true about FILE *fp


FILE is a structure and fp is a pointer to the structure of FILE type

Which of the following function is used for sets the position to a desired point in the file
Fseek()

If there is any error while opening a file, fopen will return?


NULL

Which of the following function is used for sets the position to the beginning of the file
REWIND()
Which function will return the current file position for stream
ftell()

Select a function which is used to read a single character from a file at a time?
FGETC()

What does argc and argv indicate in command-line arguments?(Assuming: int main(int argc,
char*argv[]))
argument count, argument vector

Queue is also called a data structure.


FIFO

Stack is also called a data structure.


LIFO

Pushing an element into stack already having five elements and stack size of 5 , then stack becomes
STACK OVERFLOW

_ Removes an item from the queue


DEQUEUE

Process of inserting an element in stack is called


PUSH

_____ Adds an item to the queue.


Enqueue

In a stack, if a user tries to remove an element from empty stack it is called


UNDERFLOW

You might also like