Tolal:206 Click:
1
2 3 4 5 6 7 8 9 10 11
C Interview Questions And Answers
Page 1
Ques: 1 Which of the following is the structure of an if statement?
A. if (conditional expression is true) thenexecute this codeend if
B. if (conditional expression is true)execute this codeend if
C. if (conditional expression is true) {then execute this code>->}
D. if (conditional expression is true) then {execute this code}
Ans:
d
Ans:
B
Ques: 2 string constants should be enclosed with
a.single quotes
b.double quotes
Ans:
double quotes
Ans:
b
Ans:
b).double quotes
Ans:
b).double quotes
Ans:
b.double quotes
Ans:
double quotes
Ans:
double quotes
Ques: 3 What is C?
Ans:
c is super set of all language
Ans:
c is a structured programing language
Ques: 4 write a c program to accept a number between 3 & 10 & print a square of stars.
if user enters 4 the output should be as shown ****
* *
* *
****
Ans:
#include <stdio.h>
main()
{
int count;
printf("\n**************");
for( count = 1 ; count <= 8 ; ++count)
print f("\n* *");
printf("\n**************\n");
}
Ans:
#include<stdio.h>
#include<conio.h>
void main()
{
int row,i,j,k;
printf("enter the no of row::");
scanf("%d",&row);
for(i=0;i<row;i++)
{
if(i==0||i==row-1)
{
for(j=0;j<row;j++)
printf("*");
}
else
{
for(j=0;j<row;i++)
{
if(j==0||j==row-1)printf("*");
else
printf("*");
}
printf("\n");
}
getch();
}
Ans:
#include <stdio.h>
void main()
{
int count,a;
printf("\n-------------------------\n");
printf("\n enter the number=");
scanf("%d",&a);
if(9<a>2)
{
for( count = 1 ; count <= a ; ++count)
print f("\n* ");
}
else
printf("number must be in between 3 to 8");
printf("\n-------------------------\n");
}
Ques: 5 Is that possible to pass a structure variable to a function/ If so,explain the detailed ways?
Ans:
yes it is possible to pass structure variable to a function
struct emp
{
int eno;
};
void disp(struct emp e)
{
printf(e.eno);
}
void main()
{
struct emp e;
e.eno=10;
disp(e);
}
Ans:
We can pass a structure variable to a function.
for that a variable of type structure is taken as argument in fn and structure variable is passed in fn call.
Ques: 6 Write a C program to compute the maximum depth in a tree?
Ques: 7 Write a C program to find the minimum value in a binary search tree.
Ques: 8 Write C code to determine if two trees are identical.
Ques: 9 Write a C program to delete a tree (i.e, free up its nodes)
Ques: 10 Write a C program to determine the number of elements (or size) in a tree.
Ques: 11 Write a C program to find the depth or height of a tree.
Ques: 12 How would you detect a loop in a linked list? Write a C program to detect a loop in a linked list.
Ques: 13 How do you reverse a linked list without using any C pointers?
Ques: 14 Write a C program to sort a linked list.
Ques: 15 How do you sort a linked list?
Ques: 16 How do you reverse a doubly linked list?
Ques: 17 How do you reverse a singly linked list?
Ques: 18 What is the difference between malloc() and calloc()?
Ques: 19 How is a NULL pointer defined?
Ans:
Int *p=NULL:
Ques: 20 How is it different from an unutilized pointer?
Goto Page:
1
2 3 4 5 6 7 8 9 10 11
C Objective
C Objective Questions And Answers
C Interview Questions And Answers
C Subjective Questions And Answers
R4R,C Objective, C Subjective, C Interview Questions And Answers,C,C Interview,C Questions ,C Answers