| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2? | | 6 |
| what is the advantage of using SEMAPHORES to ORDINARY
VARIABLES??? | NSN | 1 |
| write a addition of two no. program with out using
printf,scanf,puts . | | 3 |
| regarding the scope of the varibles;identify the incorrect
statement:
a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression
| TCS | 1 |
| define function | Assurgent | 4 |
| Consider a language that does not have arrays but does have
stacks as a data type.and PUSH POP..are all defined .Show
how a one dimensional array can be implemented by using two
stacks. | Google | 3 |
| 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 |
| what is the difference between declaration ,defenetion and
initialization of a variable? | LG-Soft | 5 |
| What are the uses of pre-processor directives? | | 2 |
| How can I set an array's size at run time? | | 7 |
| what is op?
for(c=0;c=1000;c++)
printf("%c",c); | Trigent | 18 |
| Why doesn't the code "int a = 1000, b = 1000;
long int c = a * b;" work? | | 6 |
| what is diff between localstatic and globalstatis variable
possible 2 use in another file...? | HCL | 2 |
| how memory store byte
| Huawei | 3 |
| Which command is more efficient?
*(ptr+1) or ptr[1] | | 3 |
| Given an unsigned integer, find if the number is power of 2? | | 3 |
| What will be the result of the following program?
main()
{
char p[]="String";
int x=0;
if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation
| IBM | 10 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 6 |
| what is meant by the "equivalence of pointers and arrays" in
C? | Satyam | 3 |
| what is memory leak?
| | 3 |
| |
| For more C Interview Questions Click Here |