| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| I use turbo C which allocates 2 bytes for integers and 4
bytes for long. I tried to declare array of size 500000 of
long type using the following code...
long *arr;
arr=(long *)(malloc)(500000 * sizeof(long));
It gives a warning that "Conversion may lose significant
digits in function main"...
And the resulting array size was very less around 8400 as
compared to 500000. Any suggestions will be welcomed....
| | 2 |
| wite a programme in c to linear search a data using flag and
without using flags? | TCS | 3 |
| #define DCHAR char*
typedef char* TCHAR;
if using these following variables will be declared like
DCHAR ch1, ch2;
TCHAR ch3, ch4;
then what will be types of ch1, ch2, ch3 and ch4?
| NDS | 1 |
| dibakar & vekatesh..uttejana here..abt ur reply for in
place reversal of linked list..wats p stands for there? | | 1 |
| In the following code segment what will be the result of the
function,
value of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}
a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
| IBM | 1 |
| #include<stdio.h>
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}
Tell me the output? | Ramco | 5 |
| what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
} | | 4 |
| if a person is buying coconuts of Rs10,and then sell that
coconuts of Rs9,with the loss of one rupee.After that the
person became a millaniore.how? | Wipro | 5 |
| How can I access memory located at a certain address? | | 2 |
| Define function ?Explain about arguments? | Geometric-Software | 2 |
| main()
{
printf("hello%d",print("QUARK test?"));
}
| | 4 |
| Dear Sir,
we are required the bubble sorting programs
Regs
Prem | | 1 |
| What is the purpose of Scanf Print, getchar, putchar,
function? | | 2 |
| what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
| | 2 |
| What are the uses of pre-processor directives? | | 2 |
| 1,4,8,13,21,30,36,45,54,63,73,?,?. | Franklin-Templeton | 5 |
| 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 |
| Describe advantages and disadvantages of the various stock
sorting algorithms | Microsoft | 1 |
| Difference between null pointer and dangling pointer? | Wipro | 3 |
| Program to write some contents into a file using file
operations with proper error messages. | | 1 |
| |
| For more C Interview Questions Click Here |