No. 1 Fresher Jobs Website in India.
Are you employer? Register to Post Jobs Login
Search Jobs

Technical - C & C++ - Example Paper 16 by PCS

Details of Technical - C & C++ - Example Paper 16 by PCS conducted by PCS for job interview.
Share Us With Others
Sample Test Paper

#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:\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 = 17, and loop is executed for 169 times */

#include
main()
{
func(1);
}
func(int i){
static char *str[] ={ "One","Two","Three","Four"};
printf("%s\n",str[i++]);
return;
}
/* Ans:- it will give warning because str is pointer to the char but
it is initialized with more values
if it is not considered then the answer is Two */

#include
main()
{
int i;
for (i=1;i printf("%d %d\n",i,l);}
printf("LOOPS= %d\n", lc-1);
}
/* Ans: i = 16, and loop is executed for 169 times */