Dharma Placement Question Papers
Give the output of the programs in each case unless mentioned otherwise
void main()
{
int d=5;
printf("%f",d);
}Ans: Undefined
void main()
{
int i;
for(i=1;i<4,i++)
switch(i)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i) case 4:printf("%d",i);
}Ans: 1,2,3,4
void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}Ans: 6
void main()
{
unsigned i=1; /* unsigned char k= -1 => k=255; */
signed j=-1; /* char k= -1 => k=65535 */
/* unsigned or signed int k= -1 =>k=65535 */
if(i<j)
printf("less");
else
if(i>j)
printf("greater");
else
if(i==j)
printf("equal");
}Ans: less
void main()
{
float j;
j=1000*1000;
printf("%f",j);
}
1. 1000000
2. Overflow
3. Error
4. None
Ans: 4
How do you declare an array of N pointers to functions returning pointers to functions returning pointers to characters? Ans: The first part of this question can be answered in at least three ways:
Build the declaration up incrementally, using typedefs:
typedef char *pc; /* pointer to char */
typedef pc fpc(); /* function returning pointer to char */
typedef fpc *pfpc; /* pointer to above */
typedef pfpc fpfpc(); /* function returning... */
typedef fpfpc *pfpfpc; /* pointer to... */
pfpfpc a[N]; /* array of... */
Use the cdecl program, which turns English into C and vice versa:
cdecl> declare a as array of pointer to function returning pointer to function returning pointer to char char *(*(*a[])())()
cdecl can also explain complicated declarations, help with casts, and indicate which set of parentheses the arguments go in (for complicated function definitions, like the one above). Any good book on C should explain how to read these complicated C declarations "inside out" to understand them ("declaration mimics use"). The pointer-to-function declarations in the examples above have not included parameter type information. When the parameters have complicated types, declarations can *really* get messy. (Modern versions of cdecl can help here, too.)
A structure pointer is defined of the type time . With 3 fields min,sec hours having pointers to intergers.
Write the way to initialize the 2nd element to 10.
In the above question an array of pointers is declared. Write the statement to initialize the 3rd element of the 2 element to 10
int f()
void main()
{
f(1);
f(1,2);
f(1,2,3);
}
f(int i,int j,int k)
{
printf("%d %d %d",i,j,k);
}What are the number of syntax errors in the above?
Ans: None.
void main()
{
int i=7;
printf("%d",i++*i++);
}Ans: 56
#define one 0
#ifdef one
printf("one is defined ");
#ifndef one
printf("one is not defined ");
Ans: "one is defined"
void main()
{
intcount=10,*temp,sum=0;
temp=&count;
*temp=20;
temp=∑
*temp=count;
printf("%d %d %d ",count,*temp,sum);
}
Ans: 20 20 20
There was question in c working only on unix machine with pattern matching.
what is alloca() Ans : It allocates and frees memory after use/after getting out of scope
main()
{
static i=3;
printf("%d",i--);
return i>0 ? main():0;
}
Ans: 321
char *foo()
{
char result[100]);
strcpy(result,"anything is good");
return(result);
}
void main()
{
char *j;
j=foo()
printf("%s",j);
}
Ans: anything is good.
void main()
{
char *s[]={ "dharma","hewlett-packard","siemens","ibm"};
char **p;
p=s;
printf("%s",++*p);
printf("%s",*p++);
printf("%s",++*p);
}Ans: "harma" (p->add(dharma) && (*p)->harma)
"harma" (after printing, p->add(hewlett-packard) &&(*p)->harma)
"ewlett-packard"
-
IT Companies Papers
- 3i Infotech Papers
- ABB Papers
- Accenture Papers
- Aditi Papers
- Adobe Papers
- ADP Papers
- Agile Papers
- Agreeya Papers
- Alcatel Papers
- ALLFON Papers
- Alter Papers
- Alumnus Papers
- Amdocs Papers
- AMI Papers
- ANZ Papers
- AppLabs Papers
- ASDC Papers
- Ashok LeyLand Papers
- Aspire Papers
- Asto Origin Papers
- Atlas Copco Papers
- Axes Papers
- Aztec Papers
- BAAN Papers
- Bajaj Papers
- BEL Papers
- Bently Nevada Papers
- BFL Papers
- BHEL Papers
- Birlasoft Papers
- BlueStar Papers
- BOB Papers
- BOSCH Papers
- BPL Papers
- Brakes India Papers
- BSNL Papers
- C-DOT Papers
- Cadence Papers
- Calsoft Papers
- Campaq Papers
- Canarys Papers
- Capgemini Papers
- Caritor Papers
- Caterpillar Papers
- CDAC Papers
- Celstream Papers
- CGI Papers
- Changepond Papers
- Chatargee Papers
- Cisco Papers
- Citicorp Papers
- CMC Papers
- COGNIZENT Papers
- Computer Assosiates
- Convergys Papers
- COSL Papers
- Covansys Papers
- Crompton Papers
- CSC Papers
- CTS Papers
- Daimler Papers
- Dell Papers
- Deloitte Papers
- Delphi-tvs Papers
- DEShaw Papers
- Deutsche Papers
- Dharma Papers
- Digital Papers
- DRDO Papers
- DSL Papers
- DSQ Papers
- DSRC Papers
- EasyTech Papers
- EFFIGENT INDIA Papers
- efunds Papers
- EIL Papers
- ELGI Papers
- ELICO Papers
- Epson Papers
- Ericssion Papers
- Essar Papers
- FCG Papers
- Flextronics Papers
- Forbes Marshall Papers
- FORCE Papers
- Future Software Papers
- FX Labs Papers
- GDA Papers
- GE Papers
- Genpact Papers
- Geodesic Papers
- Geometric Papers
- Global edge Papers
- Godrej Papers
- Google Papers
- Grapcity Papers
- GSSL Papers
- HAL Papers
- HCL EAI Papers
- HCL Technologies Papers
- Hello Soft Papers
- Hexaware Papers
- HFCL Papers
- Ho lool Papers
- Honeywell Papers
- Horizon Papers
- HP Papers
- HSBC GLTi Papers
- Huawei Papers
- Hughes Papers
- I-Flex Papers
- I-Gate Papers
- i2 technologies Papers
- IBM Papers
- IBS Papers
- ICICI Infotech Papers
- Iikanos Papers
- Iindus logic Papers
- Ikosindia Papers
- Impetus Papers
- inautix Papers
- Infineon Papers
- Infosys Papers
- infotech Papers
- Intec Papers
- Integra Papers
- Integraphr Papers
- Interwoven Papers
- iSoft Papers
- Ispat Papers
- ISRO Papers
- Ittiam Papers
- Ivega Papers
- J&B Papers
- Jataayu Papers
- Jet Airways Papers
- JKT Papers
- Kanbay Papers
- Keane Papers
- Kenexa Papers
- Kkshema Papers
- Kyocera Papers
- L & T Infotech Papers
- L&T Emsys Papers
- L&T(EEC) Papers
- LCube Technologies Papers
- LG Soft India Papers
- Lifetree Papers
- Logica CMG Papers
- Lucent Papers
- M-Phasis Papers
- MA Papers
- Mascot Papers
- Mastek Papers
- Matrix Papers
- MAXSOFT Papers
- McA fee Papers
- MECON Papers
- Mentor Papers
- Microsoft Papers
- Mindtree Papers
- Mistral Papers
- Motorola Papers
- MTNL Papers
- Nagarro Papers
- NCR Netware Papers
- Ness Papers
- Newgen Papers
- NFL Papers
- Nihilent Papers
- NIIT Papers
- Novartis Papers
- Novell Netware Papers
- NTPC Papers
- Nucleus Papers
- Ocwen Papers
- OnMobile Papers
- Oracle Papers
- Orange Papers
- Paragon Papers
- PCS Papers
- Perot Papers
- Persistent Papers
- Philips Papers
- Polaris Papers
- Poor nam Papers
- Pramati Papers
- ProdEx Papers
- PSI Data System Papers
- Quark Papers
- Quinnox Papers
- Qwest Papers
- R Systems Papers
- Ramco Papers
- Rapidigm Papers
- Redpine Papers
- Reliance(RIL) Papers
- Robert Bosch Papers
- RSsoftware Papers
- Sahi Systems Papers
- Samsung Papers
- Samtel Papers
- SAP Labs Papers
- Sasken Papers
- Satyam Papers
- Scandent Papers
- SCT Papers
- SemanticSpace Papers
- SIEMENS Papers
- SkyTECH Papers
- SlashSupport Papers
- Snecma Papers
- sobha Renaissance Papers
- SoftSol Papers
- Sonata Papers
- STMicroelectronics Papers
- Subex Papers
- SUN Papers
- Suther land Papers
- Symphony Papers
- Syntel Papers
- Talisma Papers
- Tata Elxsi Papers
- TATA Infotech Papers
- Tata Motors Papers
- Tavant Papers
- TCS Papers
- Tech Mahindra Papers
- TELCO Papers
- Telserra Papers
- TEMNOS Papers
- Tesco Papers
- Texas Instruments Papers
- Think Soft Papers
- TISL Papers
- Torry Harris Papers
- Triad Papers
- Trianz Papers
- Trilogy Papers
- TSPL Papers
- TVS Lucas Papers
- UbiNetics Papers
- US Technology Papers
- ValueLabs Papers
- ValueOne Papers
- VariFone Papers
- VERITAS Papers
- Verizon Papers
- Vernalis Papers
- Virtusa Papers
- Visual Soft Papers
- VIT Papers
- Vizual Papers
- Vsworx Papers
- WepIndia Papers
- Wilco Papers
- Wipro Papers
- Xansa Papers
- Yahoo Papers
- Yantro Papers
- YASH Papers
- Zenith Papers
- Zenser Papers
- ZTE Papers
All Information about Interview. Tips and Guideline. www.interviewGHOST.com
What Users Asked:
Advertisement: