Pointers

Q1: Which statement will you add to the following program to ensure that the program outputs "AptitudeCrack" on execution?
#include<stdio.h>

int main()
{
    char s[] = "AptitudeCrack";
    char t[25];
    char *ps, *pt;
    ps = s;
    pt = t;
    while(*ps)
        *pt++ = *ps++;

    /* Add a statement here */
    printf("%s\n", t);
    return 0;
}

A *pt='';

B pt='\0';

C pt='\n';

D *pt='\0';

ANS:D - *pt='\0';

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.