What will be the output of the following C code?
char word[20 ] = "1.234555 WELCOME";
char *w; double dis;
dis= strtod(word, &w);
printf("The number is %lf\n", dis);
printf("String is |%s|", w);
char word[20 ] = "1.234555 WELCOME";
char *w; double dis;
dis= strtod(word, &w);
printf("The number is %lf\n", dis);
printf("String is |%s|", w);A. The number is 1.234555 String is |WELCOME|
B. The number is 1.2345550 String is |WELCOME|
C. The number is 1.234555 String is |1.234555 WELCOME|
D. Errror
Answer: Option A
Which standard library function is used to calculate the length of a string in C?
A. strlen()
B. strlength()
C. stringlen()
D. strsize()
What is the purpose of the 'printf' function in C?
A. To print formatted text to the standard output
B. To read text from the standard input
C. To open a file
D. To close a file
Which library should be included to use the 'sqrt' function in C?
A. math.h
B. stdlib.h
C. cmath.h
D. algorithm.h
What does the 'strcmp' function in C do?
A. Compares two strings and returns an integer indicating their relationship
B. Copies one string to another
C. Concatenates two strings
D. Searches for a substring

Join The Discussion