C Viva Questions.........................

Viva Questions For C lab Examination...

1. C is ----------------type of language ?

Ans-Procedural.

2.Which are primitive datatypes in C?

Ans-int,Float,Char,Double,void ;

3.Memory size 0f int datatype?

Ans-2 bytes

4.Memory size of Character Datatype?
 

Ans-one bytes

5.Memory size of Float Datatype?

Ans-4 Bytes

6.What will be output of following code?

while(1)
{
 printf("A");
}

Ans- Character A will be pritented on Screen until Heap memory is full. After that program terminates..

7.Difference b/w while and do...While?

Ans- While is Entry control loop.
      Do While is Exit control Loop.


8.Which are user defined data types in C ?

Structure , Enumeration

9. What will following Statement indicates?

 const int Key=10;

Ans- key is declared as Constant throughout the program key will have value 10

10.Difference b/w function declaration and function defenition?
 

       Ans- Declaration means declaring a function.
       eg- int sum(int,int);
        It tell the compiler that we will use this function.
       Defention means we are telling what the function will do..
       eg- int sum(int a,int b)
       {
         int sum;
         sum=a+b;
          return(sum);
     }


11.Syntax for function defenition?

 returntype function name( datatype argument1,datatype argument1,.........argument n)
{
  //statements
 return( return value);
}



Related Posts:--
Data Structures Viva Questions

 

How can you Safely Use Pen can drives?

How can you Safely Use Pen can drives?

 Problem occur while using pen drives

Spreading of virus through pen drive is quite often.  When u copy some data’s from other computer then chance of spreading virus is quite often.

AM I  safe with an anti virus and update regularly?

Not completely because all anti virus are made for some virus. Every anti virus is not capable of removing all viruses.

Solution

First of all you need to install a new OS .Say for example UBUNTU .Note that second OS will not be any version of primary OS.
It is better using any Linux OS because. It is open source and virus free.  Now when ever u wants to plug a pen drive Log onto Secondary OS and open pen drive. Then you can see all files in the pen drive including virus files. Normally in windows these virus files are hidden and thus we cannot see. Delete that files and search whether it is present in other folders. Remove if it found there.

How will you identify a virus?

Case 1: - It is not a difficult task. Consider u had copied only mp3 songs from other computer. Then any other files see other than mp3 type are viruses.
Note: - There may be 1 hidden files “thum.db” which is not virus .its thumb nail image of that folder.

Case 2:- if u copied images or video files case 1 is true here.

Case 3: - If copied software .Now thing will be more difficult. Here u needs to know virus files name in advance. If found delete it .If u don’t know virus name then use another method. Normally virus are presented outside all the folders . and that would be found in all folders too. Try to find all and delete it

Now Enjoy safely using pen drive and save Pc from Viruses


Data Structure Viva Questions

Q1.What is a Register?

Ans- A register is a small amount of memory within the CPU that is used to temporarily store instructions and data.

Q2.An _________ data type is a keyword of a programming language that specifies the amount of memory needed to store data and the kind of data that will be stored in that memory location?

Ans-abstract

Q3.What are the different Abstract Data Type Groups?

A) Integer, Floating-Type, Character & Boolean are the four different data type groups
Explanation: You determine the amount of memory to reserve by determining the appropriate abstract data type group to use and then deciding which abstract data type within the group is right for the data. The different abstract data type groups are Integer, Floating-Type, Character & Boolean

Q4.Which of the following abstract data types are NOT used by Integer Abstract Data type group?

A) Short
B) Int
C) float
D) long
Explanation: The integer abstract data type group consists of four abstract data types used to reserve memory to store whole numbers: byte, short, int , and long

Q5.What pointer type is used to implement the heterogeneous linked list in C?

The answer is the void pointer. The heterogeneous linked list contains different data types in it's nodes and we need a link, pointer, to connect them. Since we can't use ordinary pointers for this, we use the void pointer. Void pointer is a generic pointer type, and capable of storing pointer to any type.

Q6.What is the minimum number of queues needed to implement the priority queue?

Two. One queue is used for the actual storing of data, and the other one is used for storing the priorities.

Q7.Which data structure is used to perform recursion?

The answer is Stack. Stack has the LIFO (Last In First Out) property; it remembers it's ‘caller’. Therefore, it knows to whom it should return when the function has to return. On the other hand, recursion makes use of the system stack for storing the return addresses of the function calls.
Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written explicit, stack is to be used.

Q8.What are some of the applications for the tree data structure?

1- Manipulation of the arithmetic expressions.
2- Symbol table construction.
3- Syntax analysis.

Q9.Which data strucutres algorithm used in solving the eight Queens problem?

Backtracking

Q10.In an AVL tree, at what condition the balancing is to be done?

If the "pivotal value", or the "height factor", is greater than one or less than minus one.

Q11.There are 8, 15, 13, and 14 nodes in four different trees. Which one of them can form a full binary tree?

The answer is the tree with 15 nodes. In general, there are 2^n-1 nodes in a full binary tree.
By the method of elimination:
Full binary trees contain odd number of nodes, so there cannot be full binary trees with 8 or 14 nodes. Moreover, with 13 nodes you can form a complete binary tree but not a full binary tree. Thus, the correct answer is 15.
comments powered by Disqus