adithya_spec
Broken In
hi guys
1>how to write a c program so that the whole program shud print in the output and then the reqiured statements without using printf().
2>how to swap the values of two integer without using temporary variables as well as any arithmetic operations
3>i wrote a program as below
void main()
{
char c[30]="c is tough";
char *p="no";
printf("%d",((sizeof(c)-sizeof(p)));
}
and i got the output as
8
why i expected it to be
-1 (since c is the 0th element and its size is 1 and p is a pionter and its size is 2)
4>another program
void main()
{
printf("%d",printf("hello"));
}
the output of this will be
hello5
why is that 5 of course hello has 5 letters but why shud it come?
is there any good book which has these type of questions
other than "test ur c skills"
if there please tell me.
1>how to write a c program so that the whole program shud print in the output and then the reqiured statements without using printf().
2>how to swap the values of two integer without using temporary variables as well as any arithmetic operations
3>i wrote a program as below
void main()
{
char c[30]="c is tough";
char *p="no";
printf("%d",((sizeof(c)-sizeof(p)));
}
and i got the output as
8
why i expected it to be
-1 (since c is the 0th element and its size is 1 and p is a pionter and its size is 2)
4>another program
void main()
{
printf("%d",printf("hello"));
}
the output of this will be
hello5
why is that 5 of course hello has 5 letters but why shud it come?
is there any good book which has these type of questions
other than "test ur c skills"
if there please tell me.