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));
}
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 |
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
how to check whether a linked list is circular.
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
Develop a routine to reflect an object about an arbitrarily selected plane
abcdedcba abc cba ab ba a a
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??