| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the use of using linked list and array? | Infosys | 9 |
| ABCDCBA
ABC CBA
AB BA
A A | | 1 |
| study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above | Accenture | 13 |
| What are bit fields? What is their use? | Adobe | 1 |
| What is false about the following
A compound statement is
a.A set of simple statments
b.Demarcated on either side by curly brackets
c.Can be used in place of simple statement
d.A C function is not a compound statement.
| TCS | 1 |
| write a program for even numbers? | | 8 |
| How would you sort a linked list? | | 1 |
| two variables are added answer is stored on not for third
variable how it is possible? | | 3 |
| what is the difference between entry control and exit
control statement? | | 2 |
| 5. What kind of sorting is this:
SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,........n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]<k[min]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;
3.[Sorted Values will be returned]
A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort
| Accenture | 2 |
| without a terminator how can we print a message in a printf
() function. | NIIT | 5 |
| Give the output for the following program.
#define STYLE1 char
main()
{
typedef char STYLE2;
STYLE1 x;
STYLE2 y;
clrscr();
x=255;
y=255;
printf("%d %d\n",x,y);
}
| ADITI | 1 |
| Write a c code segment using a for loop that calculates and
prints the sum of the even integers from 2 to 30, inclusive? | | 2 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| long int size
a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes
| HCL | 11 |
| what is dangling pointer? | LG-Soft | 1 |
| what is the difference b/w compiler and debugger? | Assurgent | 1 |
| what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
| | 2 |
| What is meant by global static? why we have to use static
variable instead of Global variable | L&T | 2 |
| explain about storage of union elements. | Bosch | 2 |
| |
| For more C Interview Questions Click Here |