kaldin

  • Login

C Programming


8) What will be the output of the program ?

#include<stdio.h>

int main()
{
    char str[] = "Nagpur";
    str[0]='K';
    printf("%s, ", str);
    str = "Kanpur";
    printf("%s", str+1);
    return 0;
}
  • A)

  • B)

  • C)

  • D)

Previous Next
Show Answer:
Show Answer


More Question
How many times the while loop will get executed if a short int is 2 byte wide #includestdio.hint main() int j=1; while(j = 255) printf(c d\n, j, j); j++; return 0;
Which of the following statement is correct about the program #includestdio.hint main() FILE fp; char ch; int i=1; fp = fopen(myfile.c, r); while((ch=getc(fp))!=EOF) if(ch == '\n') i++; fclose(fp); return 0;
The first argument to be supplied at command-line must always be count of total arguments.
What will be the output of the program #includestdio.h#define SQR(x)(xx)int main() int a, b=3; a = SQR(b+2); printf(d\n, a); return 0;
Which of the following statements are correct about an array 1: The array int num[26]; can store 26 elements.2: The expression num[1] designates the very first element in the array.3: It is necessary to initialize the array at the time of declaration.4: The declaration num[SIZE] is allowed if SIZE is a macro.