| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
| CitiGroup | 3 |
| what is the difference between #include<stdio.h> and
#include"stdio.h" ? | TCS | 4 |
| Write a program or provide a pseudo code to flip the 2nd bit
of the 32 bit number ! (Phone Screen) | NetApp | 1 |
| How does C++ help with the tradeoff of safety vs. usability?
| | 1 |
| We can draw a box in cprogram by using only one printf();&
without using graphic.h header file? | NIIT | 2 |
| What is the difference between char a[] = "string"; and
char *p = "string"; ? | Honeywell | 8 |
| Which command is more efficient?
*(ptr+1) or ptr[1] | | 3 |
| Explain the differences between public, protected, private
and internal. | | 1 |
| Write a function that accepts two numbers,say a and b and
makes bth bit of a to 0.No other bits of a should get
changed. | Scientific-Atlanta | 2 |
| How can I invoke another program from within a C program? | | 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 | 12 |
| int *p=20;
if u print like dis printf("%d",p);
o\p:- 20; how is it possible?
plz give me the explanation. | Global-Edge | 5 |
| Study the Following Points:
a.One Cannot Take the address of a Bit Field
b.bit fields cannot be arrayed
c.Bit-Fields are machine Dependant
d.Bit-fields cannot be declared as static
1. Which of the Following Statements are true w.r.t Bit-
Fields
A)a,b&c B)Only a & b C)Only c D)All
| Accenture | 1 |
| Program to find the absolute value of given integer using
Conditional Operators | N-Tech | 2 |
| what is the differnce between AF_INET and PF_INET? | Wipro | 1 |
| How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance | US-Technology | 5 |
| read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after
executing this code?
a.200
b.1
c.-1
d.50
| TCS | 2 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 2 |
| What are advantages and disadvantages of recursive
calling ? | HP | 6 |
| write a addition of two no. program with out using
printf,scanf,puts . | | 2 |
| |
| For more C Interview Questions Click Here |