Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


main( )

{

char *q;

int j;

for (j=0; j<3; j++) scanf(“%s” ,(q+j));

for (j=0; j<3; j++) printf(“%c” ,*(q+j));

for (j=0; j<3; j++) printf(“%s” ,(q+j));

}



main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%..

Answer / susie

Answer :

Explanation:

Here we have only one pointer to type char and since we take
input in the same pointer thus we keep writing over in the
same location, each time shifting the pointer value by 1.
Suppose the inputs are MOUSE, TRACK and VIRTUAL. Then for
the first input suppose the pointer starts at location 100
then the input one is stored as

M
O
U
S
E
\0
When the second input is given the pointer is incremented as
j value becomes 1, so the input is filled in memory starting
from 101.

M
T
R
A
C
K
\0
The third input starts filling from the location 102

M
T
V
I
R
T
U
A
L
\0
This is the final value stored .

The first printf prints the values at the position q,
q+1 and q+2 = M T V

The second printf prints three strings starting from
locations q, q+1, q+2

i.e MTVIRTUAL, TVIRTUAL and VIRTUAL.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

1 Answers  


Link list in reverse order.

8 Answers   NetApp,


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  


How to reverse a String without using C functions ?

33 Answers   Matrix, TCS, Wipro,


1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.

3 Answers   Wipro,


Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

0 Answers   Honeywell,


how can i cast a char type array to an int type array

2 Answers  


write a c program to print magic square of order n when n>3 and n is odd?

1 Answers   HCL,


write a origram swaoing valu without 3rd variable

2 Answers  


Categories