| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is the relation between # and include<stdio.h> | HCL | 3 |
| What is an volatile variable? | HP | 12 |
| how to add numbers without using arithmetic operators. | TCS | 10 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
what will happen if you executed this code? | Ramco | 4 |
| what is the size of an integer variable? | | 1 |
| write program on arrays
| GE | 2 |
| what is difference between array and structure?
| TCS | 19 |
| what will be the result of the following program ?
char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is :
%s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| create an SINGLE LINKED LISTS and reverse the data in the
lists completely | | 3 |
| logic for generating all the combinations of the any number
of given letters.
ex:::::::::
if a,b,c,d are given the o/p should be
abcd,dcba,dbac,bcad,................
4*3*2*1 combinations............ | Infosys | 2 |
| Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
| | 1 |
| How would you find a cycle in a linked list?
| | 2 |
| what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7
| TCS | 2 |
| Can you think of a way when a program crashed before
reaching main? If yes how? | | 2 |
| What are the commands should be given before weiting C
Program i.e, Cd.. like | Infonet | 3 |
| 1.what are local and global variables?
2.what is the scope of static variables?
3.what is the difference between static and global variables?
4.what are volatile variables?
5.what is the use of 'auto' keyword?
6.how do we make a global variable accessible across files?
Explain the extern keyword?
7.what is a function prototype?
8.what does keyword 'extern' mean in a function declaration?
| | 1 |
| Write a program that accepts a string where multiple spaces
are given in between the words. Print the string ignoring
the multiple spaces.
Example:
Input: “ We.....Are....Student “ Note: one .=1 Space
Output: "We Are Student" | IBM | 4 |
| HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT
IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE | | 2 |
| what are the uses of structure? | HCL | 5 |
| Describe advantages and disadvantages of the various stock
sorting algorithms | Microsoft | 1 |
| |
| For more C Interview Questions Click Here |