All India Exams
Home AptitudeBankEngineeringEnglishGKInterviewOnline TestPlacement PapersReasoning
  • Home
  • Aptitude
  • Bank
  • Engineering
  • English
  • GK
  • Interview
  • Online Test
  • Placement Papers
  • Reasoning

Constants C Questions And Answers

Here you can find Constants C Questions and Answers.

Why Constants C Questions and Answers Required?

In this Constants C Questions and Answers section you can learn and practice Constants C Questions and Answers to improve your skills in order to face technical inerview conducted by Banks. By Practicing these interview questions, you can easily crack any Bank Exams interview.

Where can I get Constants C Questions and Answers?

AllIndiaExams provides you lots Constants C Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Constants C Questions and Answers as PDF files and eBooks.

How to solve these Constants C Questions and Answers?

You no need to worry, we have given lots of Constants C Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Bank Exams interview.

Constants C Questions and Answers

1. What is the output of this C code? int main() { enum {ORANGE = 12, MANGO, BANANA = 11, APPLE}; printf("APPLE = %d\n", APPLE); }

Constants C Questions and Answers

2. What is the output of this C code? int main() { printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER"); }

Constants C Questions and Answers

3. For the following code snippet: char *str = “AllIndiaExams.in\0? “training classes”; The character pointer str holds reference to string:

Constants C Questions and Answers

4. What is the output of this C code? #define a 20 int main() { const int a = 50; printf("a = %d\n", a); }

Constants C Questions and Answers

5. What is the output of this C code? int main() { int var = 010; printf("%d", var); }

Constants C Questions and Answers

6. enum types are processed by?

Constants C Questions and Answers

7. What is the output of this C code? int main() { printf("AllIndiaExams\r\nclass\n"); return 0; }

Constants C Questions and Answers

8. What is the output of this C code? int main() { const int a; a = 32; printf("a is %d", a); return 0; }

Constants C Questions and Answers

9. Which is false?

Constants C Questions and Answers

10. Whats is the output of this C code? void main() { int const k = 11; k++; printf("k is %d", k); }

Home EngineeringComputer Science & EngineeringC Multiple Choice Questions & AnswersConstants

Constants - C Multiple Choice Questions and Answers

This is the c programming questions and answers section on "Const" with explanation for various interview, competitive examination and entrance test. Solved examples with detailed answer description, explanation are given and it would be easy to understand.

Constants C Questions

Online Test Name Constants
Exam Type Multiple Choice Questions
Category Computer Science Engineering Quiz
Number of Questions 11
1. What is the output of this C code?

int main()
{
enum {ORANGE = 12, MANGO, BANANA = 11, APPLE};
printf("APPLE = %d\n", APPLE);
}
  • A. APPLE= 11
  • B. APPLE= 12
  • C. APPLE= 23
  • D. APPLE= 0
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

In enum, the value of constant is defined to the recent assignment from left.

Workspace

Report Error


2. What is the output of this C code?

int main()
{
printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER");
}
  • A. C programming Class by SUPER AllIndiaExams
  • B. C programming Class by\n%s AllIndiaExams
  • C. C programming Class by %s AllIndiaExams
  • D. Compilation error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

This program has only one %s within first double quotes, so it does not read the string "SUPER.
The %s along with the AllIndiaExams is not read as a format modifier while new line character prints the new line.

Workspace

Report Error


3. For the following code snippet:
char *str = "AllIndiaExams.in\0? "training classes;
The character pointer str holds reference to string:
  • A. AllIndiaExams.in
  • B. AllIndiaExams.in training classes
  • C. AllIndiaExams.in\0training classes
  • D. Syntax error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

'\0' is accepted as a char in the string. Even though strlen will give length of string "AllIndiaExams.in, in memory str is pointing to entire string including training classes

Workspace

Report Error


4. What is the output of this C code?

#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
  • A. a = 50
  • B. a = 20
  • C. Run time error
  • D. Compilation Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

The #define substitutes a with 20 leaving no identifier and hence compilation error.
Complilation Error: expected identifier or '(' before numeric constant

Workspace

Report Error


5. What is the output of this C code?

int main()
{
int var = 010;
printf("%d", var);
}
  • A. 2
  • B. 8
  • C. 9
  • D. 10
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

010 is octal representation of 8.

Workspace

Report Error


  • «
  • 1
  • 2
  • 3
  • »

Related Topics:

  • C Data Types
  • Data Types
  • File Access
  • Typedef
  • Variable Names
  • Preprocessor
  • Standard Input and Output
  • Pointers
  • C Operators
  • Declarations

Mock Tests & Online Quizzes

  • Aptitude Online Test

  • Reasoning Online Test

  • GK Online Test

  • English Online Test

  • RRB Mock Test

  • RBI Mock Test

  • Free SBI Mock Test

  • IBPS Mock Test FREE

  • SSC Mock Test

  • CAT Exam Mock Test

  • GATE Mock Test

  • IT Courses Quiz

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions

Programming Quiz

  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • Python Programming
  • DataScience MCQ
  • Hadoop MCQ
  • Mongo DB MCQ
  • MySQL MCQ

Interview Questions

  • Java Interview Questions
  • .Net Interview Questions
  • Networking Interview Questions
  • C Language Interview Questions
  • C++ Interview Questions
  • Testing Interview Questions
  • Android Interview Questions
  • HR Interview Questions
  • Group Discussion Topics

Mock Tests

  • CAT Mock Test
  • SSC Mock Test
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test
  • RRB Mock Test
  • RBI Mock Test
  • Free SBI Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy