| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR
LOOPS.
A) * B) *****
*** * *
***** * *
***** | | 2 |
| what is the use of #pragma pack, wer it is used? | | 1 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 3 |
| write the program for prime numbers? | TCS | 7 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | L&T | 4 |
| different between overloading and overriding | | 3 |
| pgm to find middle element of linklist(in efficent manner) | Huawei | 1 |
| What are the phases in s/w developed life cycle?
wat is the diff b/w stack & queue...where do we use stack | | 5 |
| When you call malloc() to allocate memory for a local
pointer, do you have to explicitly free() it? | | 2 |
| What are the uses of pre-processor directives? | | 2 |
| what is c?
| Tech-Mahindra | 4 |
| Write a program that takes three variables(a,b,c) in as
separate parameters and rotates the values stored so that
value a goes to b,b,to c and c to a | | 2 |
| The differences between Windows XP and Windows Visa
| HCL | 6 |
| in C-programming language without using printf statement
can we get output r not ? if yes how and if no also how ?
| | 4 |
| Find Error if any in below code, Justify ur answer:
struct xx
{
int a;
struct yy
{
char c;
struct xx* p;
}
struct yy* q;
} | NDS | 2 |
| There is a 100-story building and you are given two eggs.
The eggs (and the building) have an interesting property
that if you throw the egg from a floor number less than X,
it will not break. And it will always brake if the floor
number is equal or greater than X. Assuming that you can
reuse the eggs which didn't broke; you got to find X in a
minimal number of throws. Give an algorithm to find X in
minimal number of throws. | | 2 |
| Would you rather wait for the results of a quicksort, a
linear search, or a bubble sort on a 200000 element array?
1) Quicksort
2) Linear Search
3) Bubble Sort
| | 2 |
| When is an interface "good"?
| | 1 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Find the output | CitiGroup | 4 |
| What's wrong with "char *p = malloc(10);" ? | | 4 |
| |
| For more C Interview Questions Click Here |