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

Data Types C Questions And Answers

Here you can find Data Types C Questions and Answers.

Why Data Types C Questions and Answers Required?

In this Data Types C Questions and Answers section you can learn and practice Data Types 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 Data Types C Questions and Answers?

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

How to solve these Data Types C Questions and Answers?

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

Data Types C Questions and Answers

1. Comment on the output of this C code? int main() { int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i < 5; i++) if ((char)a[i] == '5') printf("%d\n", a[i]); else printf("FAIL\n"); }

Data Types C Questions and Answers

2. The format identifier ‘%i’ is also used for _____ data type?

Data Types C Questions and Answers

3. Which data type is most suitable for storing a number 65000 in a 32-bit system?

Data Types C Questions and Answers

4. Which of the following is a User-defined data type?

Data Types C Questions and Answers

5. What is the size of an int data type?

Data Types C Questions and Answers

6. What is the output of this C code? int main() { char chr; chr = 128; printf("%d\n", chr); return 0; }

Data Types C Questions and Answers

7. Comment on the output of this C code? int main() { char c; int i = 0; FILE *file; file = fopen("test.txt", "w+"); fprintf(file, "%c", 'a'); fprintf(file, "%c", -1); fprintf(file, "%c", 'b'); fclose(file); file = fopen("test.txt", "r"); while ((c = fgetc(file)) != -1) printf("%c", c); return 0; }

Data Types C Questions and Answers

8. What is short int in C programming?

Data Types C Questions and Answers

9. Comment on the output of this C code? int main() { float f1 = 0.1; if (f1 == 0.1) printf("equal\n"); else printf("not equal\n"); }

Data Types C Questions and Answers

10. Comment on the output of this C code? int main() { float f1 = 0.1; if (f1 == 0.1f) printf("equal\n"); else printf("not equal\n"); }

Home EngineeringComputer Science & EngineeringC Multiple Choice Questions & AnswersData Types

Data Types - C Multiple Choice Questions and Answers

This is the c programming questions and answers section on " Data Types " 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.

Data Types C Questions

Online Test Name Data Types
Exam Type Multiple Choice Questions
Category Computer Science Engineering Quiz
Number of Questions 15
1. Comment on the output of this C code?

int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
  • A. The compiler will flag an error
  • B. Program will compile and print the output 5
  • C. Program will compile and print the ASCII value of 5
  • D. Program will compile and print FAIL for 5 times
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

The ASCII value of 5 is 53, the char type-casted integral value 5 is 5 only.
Output:
$ cc pgm1.c
$ a.out
FAILED
FAILED
FAILED
FAILED
FAILED

Workspace

Report Error


2. The format identifier '%i' is also used for _____ data type?
  • A. char
  • B. int
  • C. float
  • D. double
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

Both %d and %i can be used as a format identifier for int data type.

Workspace

Report Error


3. Which data type is most suitable for storing a number 65000 in a 32-bit system?
  • A. short
  • B. int
  • C. long
  • D. double
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option A

Explanation:

65000 comes in the range of short (16-bit) which occupies the least memory.

Workspace

Report Error


4. Which of the following is a User-defined data type?
  • A. typedef int Boolean;
  • B. typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
  • C. struct {char name[10], int age};
  • D. All of the mentioned
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

typedef and struct are used to define user-defined data types.

Workspace

Report Error


5. What is the size of an int data type?
  • A. 4 Bytes
  • B. 8 Bytes
  • C. Depends on the system/compiler
  • D. Cannot be determined.
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

The size of the data types depend on the system.

Workspace

Report Error


  • «
  • 1
  • 2
  • 3
  • »

Related Topics:

  • File Access
  • C Data Types
  • C Operators
  • Typedef
  • Variable Names
  • Standard Input and Output
  • Control Flow Statements
  • Structures, Unions, Bit-fields
  • C Functions
  • 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