Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
145 views
in Information Technology by (106k points)
closed by

What will be the output of the program?

main ( )

{

Char s[] = ‘AWb What the heck”;

Printf (“n%s”, s);

Printf (“%s”, s[3]);

}
1. AWbWhat the heck 
2. AWbWhat the heckb
3. W
4. AWbWhat the heckW

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 4 : AWbWhat the heckW

Explanation:

  • An array is defined as the collection of similar types of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language that can store the primitive type of data such as int, char, double, float, etc.
  •  It also can store the collection of derived data types, such as pointers, structure, etc. The array is the simplest data structure where each data element can be randomly accessed by using its index number.
  • C array is beneficial if you have to store similar elements.

By using the array, we can access the elements easily. Only a few lines of code are required to access the elements of the array.

The syntax is shown below:

data_type array_name[array_size];  

Analysis:

In the first print whole string is printed.

In the second print function, the third element is accessed. The array starts with ‘0’, so the third element is W.

The final output is:

AWbWhat the heckW

Conclusion:

Option 4 is correct.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...