#1
15th November 2014, 08:11 AM
| |||
| |||
Question Paper of Tech Mahindra
I want to get the Tech Mahindra Technical Paper, can you please provide me that ?
|
#2
15th November 2014, 10:25 AM
| |||
| |||
Re: Question Paper of Tech Mahindra
You want to get the Tech Mahindra Technical Paper, so I am giving you some questions of that paper: 1. #include * What is wrong in the following problem main() { int i,j; j = 10; i = j++ - j++; printf("%d %d", i,j); }ans: 0, 12 2.#include * What is the output of the following problem main() { int j; for(j=0;j<3;j++) foo(); } foo() { static int i = 10; i+=10; printf("%d\n",i); } /* Out put is (***since static int is used i value is retained between * 20 function calls ) * 30 * 40 */ 3.#include #include #include /* This is asked in PCS Bombay walk-in-interview * What is wrong in the following code */ main() {char * c; c = "Hello"; printf("%s\n", c); } /*ans:- Hello, The code is successfully running */ 4. #include /* This problem is given in PCS BOMBAY walk-in-interview. * What is the final value of i and how many times loop is * Executed ? */ main() {int i,j,k,l,lc=0; /* the input is given as 1234 567 */ printf("Enter the number string:<1234 567 \n"); scanf("%2d%d%1d",&i,&j,&k); for(;k;k--,i++) for(l=0;l printf("%d %d\n",i,l);} printf("LOOPS= %d\n", lc-1); }/* Ans: i = 16, and loop is executed for 169 times */ 5.#include /* This is given in PCS Bombay walk-in-interview */ /* What is the output of the following program */ main() { union { int a; int b; int c; } u,v; u.a = 10; u.b = 20; printf("%d %d \n",u.a,u.b); }/* Ans : The latest value assigned to any of the union member will be present in the union members so answer is 20 20 */ For full details of question paper I am uploading a pdf file which is free to download: |
|