1. Home
  2. Federal Board of Intermediate and Secondary Education (FBISE)
  3. Computer Science FBISE Class 10
  4. Which of these is a correct way to declare a string in C?

Added 16 Nov 2026

Which of these is a correct way to declare a string in C?

  1. string name;
  2. char name[20]; Correct answer
  3. str name;
  4. name string;

Correct answer

B. char name[20];

11 views

MCQSEXAM

Explanation

char name[20]; declares a character array that can hold a string of up to 19 characters plus the null terminator. Strings in C are arrays of characters ending with '\0'.

Reference

Asked in: Matric,FBISE

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Computer Science FBISE Class 10 MCQs

Practise all Computer Science FBISE Class 10 MCQs

Similar MCQs