| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| print ur name without using any semicolon in c/c++.... | | 6 |
| Print the foll in C...eg when n=5 the o/p must b
+ +
+ + + +
+ + + + +
+ + + +
+ + | | 1 |
| what is the differance between pass by reference and pass
by value. | Infosys | 4 |
| Give the output for the following program.
#define STYLE1 char
main()
{
typedef char STYLE2;
STYLE1 x;
STYLE2 y;
clrscr();
x=255;
y=255;
printf("%d %d\n",x,y);
}
| ADITI | 1 |
| what is the value of 'i'?
i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
| Cadence | 4 |
| Predict the output or error(s) for the following:
25. main()
{
printf("%p",main);
}
| ME | 3 |
| how to convert binary to decimal and decimal to binary in C
lanaguage | | 4 |
| how to display 2-D array elements in spiral | | 1 |
| what is diff b/w huge & far & near pointer?? | HCL | 1 |
| Write a program which take a integer from user and tell
whether the given variable is squar of some number or not.
eg: is this number is 1,4,9,16... or not
| Alcatel | 8 |
| write a program that print itself even if the source file is
deleted? | | 1 |
| write a addition of two no. program with out using
printf,scanf,puts . | | 3 |
| char ch="{'H','I',0};printf("%s",ch);what is output | Accenture | 9 |
| WAP – represent a char in binary format
| Motorola | 4 |
| f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?
| Hughes | 6 |
| 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 |
| what will happen if you free a pointer twice after
allocating memory dynamically ? | Novell | 2 |
| 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 |
| I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it? | | 3 |
| convert 12345 to 54321 withoutusing strig | | 3 |
| |
| For more C Interview Questions Click Here |