Вы находитесь на странице: 1из 3

ODM Institute Computer and Management

C viva Questions:
1. Algorithm :
Finite step by step method to solve a problem.
2. Flow chart:
Step by step pictorial Representation to solve a problem.
3. Source code: Human Readable form of a program.
4. Object Code: Machine Readable form of Code.
5. Compilation: A translator that converts a program from source code to object
code. (Alt+F9).
6. Execution (Run): CTRL+F9
7. C : invented by Denis Ritchie, At A&T BELL LABS in 1972
8. C procedure oriented language (function oriented)
9. Constant : that are fixed
10. Variable: That are not fixed. Vary during program execution.
11. Variable declaration: int a; float b; char c; double d;
12. Variable initialization (Assignment): a=2, b=4.5, c=a,
d=4.56784352134567;
13. Data type: Data type tells what type of value a variable will contain
Fundamental Data type also called Basic data type (char (1 byte), int
(2bytes), float (4 bytes), double (8 bytes), void ) . Derived data type
(function, Array, structure, union, pointer). User defined ( typedef , enum ).
14. Data Extension:
i. Short: Use efficiently allocated space.
ii. Long: increase the capacity of data type (int 2 bytes , long int
4 bytes)
iii. Signed: store one bit for sign (+ or -) rest are used for data
storage. Like int is of 2 bytes(16bits) 1 bit is used to store sign
and other 15 bits are used to store data hence range is -215 to
215 (-32768 to +32767)
iv. Unsigned: use to store Positive values all bits are used to store
data. Like int is of 2 bytes (16 bits). Here all bits are used to
store data. Because it is always positive so its range is 0 to 216 (
0 to 65535).
15. Operator: Used to perform operation on operands.
a. Arithmetic operator: +,-,/,%,* (Highest priority (/,*,%), Lowest (+,-)
b. Relational : > ,< ,<=,>= ,!=, = =
c. Assignment: =
d. Conditional: exp1? Exp2: exp2
e. Increment / Decrement : ++ ,- f. Bitwise : &, ^, , << , >>
g. Logical: &&, , !
h. Special operator: * (Value at address), &(Address of ), (.) member
selection), -> ( Membership operator ).
16. Statement: Statement are used to create program. Everything written in c is a
statement.
i. Non executable: Pre-processor (#include<stdio.h>),
Comments (// ), Declaration statement ( int a;).
ii. Executable: compound statement, Expressions, Control flow
statements.

S.D Lekhwar (Compter Science and Application).

ODM Institute Computer and Management


iii. Control flow statement
1. Conditional: used to take decision on the basis of
condition. if, if else, else-if, nested if (if inside if).
2. Iteration/ Loop/ Repetition: when we want to repeat
same statement many times in a program we will use
Loop. Entry control (while, for), exit control (do
while).
3. Case Control Statement (Switch): when we have
more than on cases and we want to execute one of them
we use switch statement.
4. Jumping control Instruction:
i. Break. Terminates loop/statement when
encountered.
ii. Continue: Maintains control in a loop
iii. Goto: Jump on a label mentioned by
goto statement.
iv. Return: mainly used in function to return
the control.
17. Function: Self-contained block of statement used for a specified task.
Predefined function ( in built in c library like printf, scanf, getch, getchar,
clrscr,getche,strupr).
18. Function declaration: return type function-name( formal argument);
19. Function calling : function name(actual argument);
20. Function definition: return type function-name (formal argument){ body }
21. Formal argument: passed during function declaration and function definition
these are optional.
22. Actual argument: passed during function calling
23. Call by value: if we make any changes in formal argument it doesnt reflect in
actual argument. Because they are on different location. In this values are
copied.
24. Call by reference: if we make any changes in formal argument it will reflect
in actual argument. Because they share same location (Address). In this we
will pass address.
25. Recursion: When function call itself.
26. Array: Derived data type. Contain similar type (Homogeneous) of element in
contiguous (touching to another) memory location.
a. One dimensional array Declaration: int a[2];
b. One dimensional array initialization: int a[5]= {4,5,6,3,2};
c. Two dimensional array Declaration: int a[2][2];
d. Two dimensional array Declaration: int a[2][2]= {{4,2},{6,9}};
27. Structure: derived data type. Contain similar dissimilar both type of values in
contiguous memory location.
a. Structure Declaration: struct student {int roll ,float marks, char
*name};
b. Structure variable Declaration: sturct student a;
28. Union: derived data type. Share memory location. Need to print first value
before assign second. Everything else is just like structure.
a. Union Declaration: union student {int a, float marks };
29. Storage class: tells where to store data, its scope, lifetime, default value.

S.D Lekhwar (Compter Science and Application).

ODM Institute Computer and Management


i. Auto: default storage class, storage location memory, scope
local, lifetime till control remain in block, default initial value
Garbage.
ii. Register: Storage location CPU, scope local, lifetime till
control remain in block, Default initial value Garbage.
iii. Static: storage Location memory, Scope Local, lifetime
maintain in different function call, default initial value zero,
iv. Extern: Storage Location memory, Scope global, lifetime till
program in execution, default initial value zero.
30. Pointer: pointer contain addresses. In pointer arithmetic addition and
subtraction operation is possible nothing else.
31. File handling: file is used to retain data.
a. File pointer: used to perform operation on file. Syntax FILE *fp;
b. File open function: used for opening file. Syntax fopen( filename,
mode),
c. Mode: can be read, write ,append, we will use first letter of each
operation in double quoutes.
i. Read = r. open a file for read.
ii. Write =w . create new file of write operation.
iii. Append=a . add data at end of the file.
32. Enum: used to create restriction on data.

S.D Lekhwar (Compter Science and Application).

Вам также может понравиться