0% found this document useful (0 votes)
12 views6 pages

C Viva

Uploaded by

SRDC CDE
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)
12 views6 pages

C Viva

Uploaded by

SRDC CDE
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/ 6

C Language Viva Questions with Answers:-

1.what is C language?
Ans:the C programming is a standardized programming language developed in 1970’s by
ken Thompson and dennis Ritchie for use on the UNIX operating system.
2.printf(“ “); for writes data to the standard output devices.
3) Expand ASCII ?
Ans: American standarad code for information interchange
4)What is binary number ?
Ans: The number which contains only 0 and 1 is called binary number.
5) Define 2”s complement ?
Ans: The given binary number is first covert the numbers 0 to1 and 1 to 0. And finally
add the 1 to the converted number. Then we will get the 2’s complement number.

6) What is the mean of sum of the individual digits?


Ans: Sum of the individual digits means adding each digit in a number
7) What is positive integer?
Ans: if the integer value is grater than zero then it is called positive integer
8) Define preprocessor ?
Ans: Before compiling a process called preprocessing is done on the source code by a
program called the preprocessor.

9) What is Fibonacci series ?


Ans: A fibonacci series is defined as follows
The first term in the sequence is 0
The second term in the sequence is 1
The sub sequent terms 1 found by adding the preceding two terms in the sequence
Formulae : let t1,t2,…………tn be terms in fibinacci sequence
t1=0, t2=1
tn=tn-2+tn-1……where n>2
10) What are the various types of unconditional statements?
Ans: goto,Break and continue
11)What are the various types of conditional statements?
Ans: if , if else ,switch statements

12) What is prime number ?


Ans: Prime number is a number which is exactly divisible by one and itself only
13)What is an algorithm?
Ans : A step by step procedure is called algorithm
14)What is flow chart?
Ans: A pictorial representation an algorithm is called a flow chart
15)What is program?
Ans : A collection of statements is called
16) What is function ?
Ans: A function is a sub program it returns a value.
17) What is procedure ?
Ans: A procedure is a sub program it does not returns a value
18) What are the basic data types in C ?
Ans: int, char, float, double
19) How to define preprocessor ?
Ans: By using the # symbal Ex: #include<stdio.h>
20) What are various types of loop statements?
Ans : While, do- while, for loop statements
21) What is the difference between while and do-while statements?
Ans: In while the condition will be checked first and then enter into a loop.
But in do- while the statements will be executed first and then finally check
The Condition.
22) How to find the roots of qudratric equtations ?
Ans: Nature of roots of quadratic equation can be known from the quadrant
= b2-4ac
If b2-4ac >0 then roots are real and unequal
If b2-4ac =0 then roots are real and equal
If b2-4ac <0 then roots are imaginary
24) List out the C features ?
Ans: Portability,flexibility, wide acceptability etc..,

25) How many types of arrays are there ?


Ans: Three types. They are one dimensional ,two dimensional and multi
dimensional arrys

26) What are the various types of arithemetic operators ?


Ans: addition (+), multiplication(*), subtraction (-), division(/) , modulo(%).
27) What are the types of relational operators ?
Ans: less than(<), grater than(>), less than or equal to(<=),equal to(==), etc..,
28) What are the types of logical operators ?
Ans: logical AND (&&), logical OR(||), logical NOT(!)

29) What is meant by palindrome ?


Ans: If the reverse of a string/number is equal to original string/ number then
it is called palindrome.
30) What is the use of gets() function ?
Ans: To read the string at a time
31) What is the use of puts() function ?
Ans: To write the string at a time

32) What is string ?


Ans: A string is an collection of characters
33) Which command is used to combined the two strings ?
Ans: Strcat()
34) Which command is used to copy the strings ?
Ans: By using the strcpy() function copies one string to another

35) Which command is used to delete the strings ?


Ans: delstr();
36) What are the various types of string functions ?
Ans: Strcat(), strcpy(), delstr(), substr() ,strlen()etc..

37) Define structure ?


Ans: Structure is amethod for packing data of different types. Structure help to
organize complex data in a more meaninigful way.
38) What is use of <math.h> header file ?
Ans: It is used to access the mathematical functions in programs.

39) What is condition for performing an matric addition ?


Ans: program takes the two matrixes of same size and performs the addition
40)what is factorial?
Ans : Factorial of a number is nothing but the multiplication of numbers from a given
number to 1
41) What is the meaning of recusive function ?
Ans: A function call it self is called recursive function
42) define library functions ?
Ans: The functions have already been written, compiled and placed in libraries and
Are called library functions.
43) Define formal parameters ?
Ans: Formal parameters are the parameters given in the function declaration ans
function definition

44) What is meant by call by value ?


Ans: passing values to the function as arguments
45) What is meant by call by reference ?
Ans: passing address to the function as arguments
46)define actual parameters ?
Ans: The actual parameters often known as arguments are specified in the function
call.

47) What is meaning of GCD ?


Ans: GCD means Greatest Common Divisor. i.e the highest number which divides
the given number
48) Define scope of a variable ?
Ans: The scope of a variable can be define as the region over which the variable
isaccessible
49) Show an scope resolution operator ?
Ans: double colon(::)
50) Define extent of a variable ?
Ans: The period of time during which memory is associated with a variable is
Called extent of the variable.
51) What is purpose of towers of Hanoi ?
Ans: We have to transfer all the disks from source to destination towers. Here
the restriction is not to place a big disk on smaller one . for this we use
intermediate tower. Finally the arrangements in the destination tower must be
as same as the disks in the source tower at first.

52) What is an array ?


Ans: An array is a sequence of memory location of same data type.

(or)

Ans: The collection of similar elements is called array

53) What is the difference between printf() and puts() ?


Ans: puts() is used to display the string at a time and it doesn’t take any integers
values but printf() takes any values as defined by the user
54) define pointer variable ?
Ans: pointer variables are defined as variable that contain the memory addresses
of data or executable code.
55) What is use of the strcmp() function ?
Ans: This function compares two strings character by character and returns a
value 0 if both strings are equal and non zero value if the strings are different.

56) What is use of strlen() ?


Ans: to read a string length
57) what is the use of getc() function ?
Ans: To read the character one by one.
58) What is the use of strstr () ?
Ans: The function strstr() searches one string for the occurrence of another. It
accepts two strings as parameters and searches the first string for an occurrence of the
second

59) What is meant by Pascal’s triangle ?


Ans: Pascal’s triangle which is used for a coefficient in the equation in polynominals
60)define structure ?
Ans: A structure in c is a heterogenous user efined data type. A structure may contain
different data types.It groups variables into a single entity.
61) What is the use of dot operator in structures ?
Ans: The use of dot(.) operator to access the members of a structure
independently. The dot operator connects a member with the structure variable.
62) Define unions ?
Ans: A union is a data type in c which allows the overlay of more than one
variable in the same memory area.

63) what are the difference between structures and unions ?


Ans: Here the major difference is with in the structure all elements must be allocated
memory. But in union highest memory allocation must be allocated the all these
elements.

64)What is a structure?
Structures in C defines the group of contiguous (adjacent) fields, such as records or
control blocks. A structure is a
collection of variables grouped together under a single name. It provides an elegant and
powerful way for
keeping related data together.

65) What are nested structures?


Structures within Structures (Nested Structures)
Structures can be used as structures within structures. It is also called as 'nesting of
structures'.

66) What is file ?

Ans: The collection of alphabets is called file

67) What are the various operations performed on the file ?


Ans: fopen(), fread(), fwrite(), fclose() etc..,
68) What is the use of file pointer ?
Ans: The file pointer must be used in subsequent operations on the file

69) List out the file handling functions ?


Ans: fopen(), fprintf(),fclose(),fscanf(),fgetc(),fputc(), etc..,
70) What is the use of fseek() function ?
Ans: The function fseek sets the file pointer associated with a stream to a new
position
71) What is use of the fflush() function ?
Ans: If the given stream has a buffered output, fflush writes the output of the stream
to the associate file.

You might also like