main()
{
char * strA;
char * strB = I am OK;
memcpy( strA, strB, 6);
}
a. Runtime error.
b. I am OK
c. Compile error
d. I am O
Answers were Sorted based on User's Feedback
Answer / chandra
Answer is (c)compile error
compiler cannot initialize the string with out "". Hence any
compiler throws an error
If the string is with in "", then answer will be(a) Runtime
error.
since the string strA is used with out being initialized
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / prashant
if quotes are inserted ans will be -->
d) I am O
Is This Answer Correct ? | 0 Yes | 3 No |
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
Is the following code legal? typedef struct a { int x; aType *b; }aType
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
Write a program to model an exploding firecracker in the xy plane using a particle system
write the function. if all the character in string B appear in string A, return true, otherwise return false.
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
Printf can be implemented by using __________ list.
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().