[go: up one dir, main page]

0% found this document useful (0 votes)
85 views11 pages

PPS Viva Questions

Uploaded by

harishve34
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)
85 views11 pages

PPS Viva Questions

Uploaded by

harishve34
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/ 11

PPS Viva Questions (SEM 1/SEM 2)

B.TECH 1st Year (2023-24)

1.Which type of language is C?

Ans: C is a high-level language and general-purpose structured programming


language.

2.What is a compiler?

Ans: Compile is a software program that transfers program developed in a high-level


language into executable object code.

3.What is an algorithm?

Ans: The approach or method that is used to solve the problem is called an
algorithm.

4.What is a C token and types of C tokens?


Ans: The smallest individual units are known as C tokens. C has six types of tokens:
Keywords, Constants, Identifiers, Strings, Operators, and Special

symbols.

5.How many Keywords (reserve words) are in C?

Ans: There are 32 Keywords in the C language.

6.What is an identifier?

Ans: Identifiers are user-defined names given to variables, functions, and arrays.

7.What are the Back Slash character constants or Escape sequence characters
available in C?

Ans: Back Slash character constants are \t, \n, \0.

8.What is a variable?

Ans: Variables are user-defined names given to memory locations and are used to
store values. A variable may have different values at different times during

program execution.

9.What are the Data Types present in C?

Ans: Primary or Fundamental Data types (int, float, char), Derived Datatypes (arrays,
pointers), and User-Defined data types (structures, unions, enum).

10.How to declare a variable?

Ans: The syntax for declaring a variable

data type variable_name-1, variable_name-2, ....variable_name-n;

Example 1: int a, b;

Example 2: float p, q;

11.What is meant by initialization and how do we initialize a variable?

Ans: While declaring a variable, assigning value is known as initialization. Variable


can be initialized by using the assignment operator (=).

12.How many types of operators are there in C?

Ans: C consists of Arithmetic Operators (+, -, *, /, %), Relational Operators (<, <=, >,
>=, !=), Logical Operators (&&, ||, !), Assignment Operators (=, +=, -=, *=,

/=), Increment and Decrement Operators (++, --), Conditional Operator(?:), Bitwise
Operators(<<, >>, ~, &, |, ^), and Special Operators (., ->, &, *, sizeof).

13.What is a Unary operator and what are the unary operators present in C?

Ans: An operator which takes only one operand is called a unary operator. C unary
operators are Unary plus (+), Unary minus (-), Increment and Decrement

operators (++, --), Address of operator (&), Value at operator (*), sizeof operator, ones
complement operator (~).

14.What is the use of the modulus (%) operator?

Ans: The modulus operator produces the remainder of an integer division. It cannot
be used on floating-point data.

15.What is the use of printf and scanf functions in C?

Ans: Values of variables and results of expressions can be displayed on the screen
using printf functions. Values to variables can be accepted through the

keyboard using scanf function.

16.Forms of IF statements?

Ans: Simple IF statement, IF-ELSE statement, NESTED IF-ELSE statement, and ELSE
IF ladder.

17.What is a goto statement?

Ans: GOTO is an unconditional branching statement which transfers control to the


specified label.

18.What is a loop?
Ans: Loop is a sequence of statements that runs repeatedly.

19.What are loop control statements in C?

Ans: While, do-while, and for.

20.What are sections present in for loop?

Ans: Initialization section, conditional section, and increment/decrement section.

21.What is the use of break statements?

Ans: The break statement is used to exit from the loop.

22.What is an array?

Ans: The array is a collective name given to similar elements.

23.How can we initialize an array?

Ans: The initializer for an array is a comma-separated list of constant expressions


enclosed in braces ({}). The initializer is preceded by an equal sign (=). You
do not need to initialize all elements in an array.

24.What is the difference between a normal variable and an array variable?

Ans: A variable can store only one value at a time whereas an array variable can store
several values at a time.

25.What are the types of Arrays?

Ans: One-Dimensional array, Two-Dimensional array, and Multi-Dimensional array.

26.What is a character array?

Ans: An array which can store several characters is called a character array.

27.What is a function?

Ans: The function is a self-contained block of the statement which is used to perform
a certain task.

28.What are the types of functions?


Ans: C functions are divided into two categories: user-defined functions and built-in
functions.

29.Which are called built-in functions?

Ans: Printf, scanf, clrscr, gotoxy, string handling functions, and file handling
functions.

30.What is a recursive function?

Ans: A function calling itself is called function recursion.

31.How to pass an array to a function?

Ans: Arrays are passed to a function by sending its address.

32.What is a pointer variable?

Ans: A pointer variable is a variable that can store the address of another variable.

33.How can we store the address of a variable in a pointer?


Ans: By using the address of the operator we can store the address of a variable in a
pointer.

34.How many bytes does a pointer variable occupy in memory?

Ans: A pointer variable irrespective of its type occupies two bytes in memory.

35.What are storage classes available in C?

Ans: Auto, static, extern, and register.

36.What is a structure?

Ans: The structure is user-defined data typed. The structure is a collective name
given to dissimilar elements.

37.How to access structure members?

Ans: Structure members can be accessed using the dot operator.

38.What are the differences between structures and arrays?


Ans: Structures store dissimilar values whereas arrays store similar values. One
structure variable can be assigned to another structure variable whereas one

array variable cannot be assigned to another array variable.

39.What is the size of a structure?

Ans: Sum of all the members' sizes becomes the structure size.

40.What is a union?

Ans: Union is a user-defined data type that can store a value of different data types.

41.What are the types of files we can create using C?

Ans: We can create text and binary files using C.

42.What are the file-handling functions present in C?

Ans: fopen, fclose, ffgetc, fputc, fgets, fputs, fprintf, fscanf, fread, fwrite, fseek
43. What are the file opening modes present in C?

Ans- r, w, a, r+, w+, a+, rb, wb, rb+, wb+

44. How to access structure members by their pointer?

Ans- We can use structure members using arrow operator with its pointer.

You might also like