| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the value of 'i'?
i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
| Cadence | 3 |
| how to find out the inorder successor of a node in a tree?? | TCS | 2 |
| void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}
in this code always gives the same result for all case | TCS | 5 |
| write a own function for strstr | LG-Soft | 1 |
| How can I access memory located at a certain address? | | 2 |
| Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
| Mascot | 2 |
| HOW TO HANDLE EXCEPTIONS IN C | | 4 |
| helllo sir ,
what is the main use of the pointer ,array ,and the
structure with the example of a programe | | 1 |
| How do I access command-line arguments? | Wipro | 2 |
| write the program for prime numbers? | TCS | 7 |
| what about "char *(*(*a[])())();"
| Oracle | 2 |
| What's a "sequence point"? | | 2 |
| printf("%d",(printf("Hello")); What it returns?
| TCS | 18 |
| What is the result
main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
| IBM | 7 |
| How many ways are there to swap two numbers without using
temporary variable? Give the each logic. | | 4 |
| Write a program to compare two strings without using the
strcmp() function | Accenture | 6 |
| print the following using nested for loop.
5 4 3 2 1
1 2 3 4
3 2 1
1 2
1
2 1
1 2 3
4 3 2 1
1 2 3 4 5 | | 4 |
| 11. Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
| Accenture | 5 |
| 44.what is the difference between strcpy() and memcpy()
function?
45.what is output of the following statetment?
46.Printf(“%x”, -1<<4); ?
47.will the program compile?
int i;
scanf(“%d”,i);
printf(“%d”,i);
48.write a string copy function routine?
49.swap two integer variables without using a third
temporary variable?
50.how do you redirect stdout value from a program to a file?
51.write a program that finds the factorial of a number
using recursion? | | 3 |
| explain memory layout of a C program | | 1 |
| |
| For more C Interview Questions Click Here |