What will be the output of the following C code?
#include <stdio.h>
int main()
{
char *s = "myworld";
int i = 9;
printf("%*s", i, s);
}
#include <stdio.h>
int main()
{
char *s = "myworld";
int i = 9;
printf("%*s", i, s);
}A. myworld
B. myworld(note: spaces to the left of myworld)
C. myworld (note:followed by two spaces after myworld)
D. Undefined
Answer: Option B

Join The Discussion