in Programming in C edited by
420 views
1 vote
1 vote
void main()
{
char*s[]={"iceland","Greenland","Ireland","Switzerland"};
char **ptr[]={s+3,s+2,s+1,s};
char ***p=ptr;
printf(\%s ",**++p);
printf(\%s ",*(*++p+3);
printf(\%s ",*p[-2]+3);
printf(\%s ",p[-1][-1]+1);
}
in Programming in C edited by
420 views

2 Answers

0 votes
0 votes
Best answer
printf(\%s ",**++p);  O/P is: Ireland

 

printf(\%s ",*{*++p+3);  O/P is : enland

 printf(\%s ",*p[-2]+3); O/P is : tzerland
selected by

3 Comments

@sushmita

i am not getting that, without the explanations, how you select this answer as BEST ?

@pradeepchaudhary

May you know the process, how to solve it, But by directly giving the answers, some other persons can't get it. ( By running this program in online compilers, everyone gets the answers )

0
0

This is really nice question

pradeepchaudhary  can you please explain me step by step .??..It's very helpful for everyone

0
0
edited by
correct answer should be 

Ireland

null

tzerland

reenland

1
1
1 vote
1 vote

I just did only 1 mistake here at address 403 in I missed  "T" I write "Swizerland " instead of "Switzerland"

edited by
by

2 Comments

@Magma why would it be Null for the second printf() statement? *(1016) can give any garbage value. So the result is undefined, isnt it? why would *(1016) print null?
0
0

yeah correct it can give any garbage value  Somoshree Datta 5

0
0

Related questions

0 votes
0 votes
2 answers
1
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true