Discussion :: Arrays
-
What will be the output of the program ?
#include
#include
void main()
{
char str[] = "Exam\0Veda";
printf("%s", str);
}
Answer : Option A
Explanation :
A string is a collection of characters terminated by '\0'.
>> char str[] = "Exam\0\Veda\0"; The variable str is declared as an array of characters and initialized with value "Exam".
>> printf("%s", str); It prints the value of the str.
The output of the program is "Exam".
Be The First To Comment