| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 4 |
| write a C program to print the program itself ?! | TCS | 7 |
| what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
| TCS | 8 |
| who is the founder of c | HP | 7 |
| If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit. | | 2 |
| the code is::::: if(condition)
printf("hello");
else
printf("world");
WHAT WILL BE THE CONDITION IN IF IN SUCH A WAY THAT BOTH
HELLO AND WORLD ARE PRINTED IN A SINGLE ATTEMPT?????? SINGLE
ATTEMPT IN THE SENSE... IT MUST FIRST PRINT "HELLO" AND IT
MUST GO TO ELSE PART AND PRINT "WORLD"..... NO LOOPS,
RECURSION ARE ALLOWED........................ | IBM | 7 |
| 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 |
| Reverse the part of the number which is present from
position i to j. Print the new number.[without using the array]
eg:
num=789876
i=2
j=5
778986 | | 2 |
| The C language terminator is
a.semicolon
b.colon
c.period
d.exclamation mark
| TCS | 3 |
| to find out the reverse digit of a given number | Infosys | 4 |
| 6. Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| what is the hexidecimal number of 4100? | Google | 13 |
| program to get the remainder and quotant of given two
numbers with out using % and / operators? | IBM | 4 |
| Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4. | | 1 |
| write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer) | Wipro | 5 |
| what is the difference between getch() and getchar()? | | 2 |
| which types of data structure will i use to convert infix to
post fix??? | IIT | 2 |
| how to find turn around time in operating system? | | 1 |
| What is the output of the program given below
#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | ADITI | 11 |
| Write a program to accept a character & display its
corrosponding ASCII value & vice versa? | | 3 |
| |
| For more C Interview Questions Click Here |