vignesh


{ City } chenna
< Country > india
* Profession * student
User No # 18021
Total Questions Posted # 0
Total Answers Posted # 88

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 974
Users Marked my Answers as Wrong # 508
Answers / { vignesh }

Question { 6817 }

A Newyorker stays in 36th floor. Daily he goes to his office
by walk and returns. While raining, he takes the lift goes
to lobby and reaches by walk to his office. In the evening
he returns to the building, takes the lift and reaches his
apartment on 36th Floor. When it is summer, he takes the
lift, goes to lobby and reaches his office by walking. In
the evening, he returns home, takes the lift goes to 30th
floor and climbs all the six floors by stair case and
reaches his apratment. Why?


Answer

fantastic answer buddy..... keep it up :)

Is This Answer Correct ?    4 Yes 2 No

Question { 6363 }

swapping of two numbers without using third variable using
AND and OR operators


Answer

however we can implement using EXoR , where it is made of
AND and OR gate too....

x=90;
y=51;
x^=y^=x;
the value of x & y will be swapped.

Is This Answer Correct ?    8 Yes 8 No


Question { 10405 }

main()
{
int i=5;
printf("%d%d%d%d",i++,i--,i);
}


Answer

some garbage value , 4,5,5...

why in this o/p garbage value is because only 3 parameters
are passed but we have assigned 4 control strings , where
one control string is useless, so for that compiler will
print garbage value....

Is This Answer Correct ?    2 Yes 4 No

Question { 3765 }

main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf(i);
}


Answer

the answer will be -1

Is This Answer Correct ?    2 Yes 0 No

Question { InterGlobal, 5099 }

A stack can be implemented only using array?if not what is used?


Answer

stack is not always implemented using array's , it can also
be implemented through linked lists in DATA STRUCTURES,,,

Is This Answer Correct ?    11 Yes 0 No

Question { Wipro, 21829 }

Program to find larger of the two numbers without using if-else,while,for,switch


Answer

#include
#include
void main()
{
int a=90 , b=-89;
(a>b)?printf("a is larger") : printf(" b is larger ");
getch();
}

thank u

Is This Answer Correct ?    7 Yes 7 No

Question { Aptech, 6203 }

while initialization of two dimensional arrays we can
initialize like a[][2] but why not a[2][] is there any
reason behind this?


Answer

the main reason behind this is that, if we specify the
columns instead of rows we can easily find out the number of
rows in the matrix...... but if we give just row number we
cant predict the number of columns...... that's why !!!!!!


thnak u

Is This Answer Correct ?    4 Yes 2 No

Question { Infosys, 21659 }

write a program that will print %d in the output screen??


Answer

void main()
{
printf("%%d");
getch();
}

where %% will print % and d will be printed asual

thank u

Is This Answer Correct ?    39 Yes 2 No

Question { 5039 }

can we declare a function inside the structure?
ex: struct book
{
int pages;
float price;
int library(int,float);
}b;
is the above declaration correct? as it has function
declaration?


Answer

no , it is not possible in C.. here structure is not a defined class.. so it is not permitted..

in C++ we can use , that is called class , A derived datatype from a structure :)

class class_name
{
ACCESS SPECIFIER : (private/public/protected)
decleration of data member;
member fucntions definitions
{
......
.........
}
};



thank u

Is This Answer Correct ?    4 Yes 3 No

Question { 4749 }

code for concatination of 2 strings with out using library
functions?


Answer

#include
#include
void strrcat(char *,char *);
void main()
{
char a[50],b[50];
int i;
clrscr();
printf("enter the string 1 :");
gets(a);
printf("enter the string 2 :");
gets(b);
strrcat(a,b);
gets(a);
getch();
}

void strrcat(char *a , char *b)
{
for(int i=0;*a!='\0';i++,a++);
for(int j=0;*b!='\0';j++,i++,b++,a++)
*a=*b;
*a='\0';
}

thank u :)

Is This Answer Correct ?    0 Yes 0 No

Question { 6166 }

wat s the meaning of (int *)p +4;


Answer

here 'p' must be a void pointer.
here (int*)p means that 'p' is type casted to point to the integer value.

that address is incremented by 4.



thank u

Is This Answer Correct ?    9 Yes 0 No

Question { 3248 }

What is Bitwise Operator and how it works?


Answer

bitwise operator is nothing but do logical manipulations in bits (lower format).

it needs 2 operands.
for eg : 7 & 2 &- bitwise AND

0000 0000 0000 0000 0111
0000 0000 0000 0000 0010
-------------------------
0000 0000 0000 0000 0010

this performs the operation in BIT level , so only C is called as middle level language and typed to be a strong ones......

| - bitwise OR
^ - bitwise EX-OR
~ - one's complement operator.


thank you

Is This Answer Correct ?    4 Yes 0 No

Question { CTS, 12398 }

I have 3 duplicate records in a file .
I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?


Answer

so , first sort the PS using JCL SORT utility and update the
PS file.
find the duplicates using XSUM . and write the duplicates
alone in a seperate PS.
take the seperate PS and give the control condition inside
SYSIN DD * as , sort fields with skiprec(3), since u need
only the 3rd one to copy

Is This Answer Correct ?    16 Yes 2 No

Prev    1   2   3   4   5    [6]