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

C Data Types Questions And Answers

Here you can find C Data Types Questions and Answers.

Why C Data Types Questions and Answers Required?

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

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

How to solve these C Data Types Questions and Answers?

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

C Data Types Questions & 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"); }

C Data Types Questions & Answers

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

C Data Types Questions & Answers

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

C Data Types Questions & Answers

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

C Data Types Questions & Answers

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

C Data Types Questions & Answers

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

C Data Types Questions & 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; . }

C Data Types Questions & Answers

8. What is short int in C programming?

C Data Types Questions & 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"); }

C Data Types Questions & 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 & AnswersC Data Types

C Data Types - C Multiple Choice Questions & Answers

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

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
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • »

Related Topics:

  • Declarations
  • Preprocessor
  • Variable Names
  • Structures, Unions, Bit-fields
  • Standard Input and Output
  • Typedef
  • C Operators
  • File Access
  • Storage Management
  • Constants

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

  • LIC Mock Test Series

  • MAT Mock Test

  • SEBI Mock Test

  • ESIC Mock Test

  • IT Courses Quiz

Newsletter

Contact Us

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning Questions
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation Questions
  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test

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
  • iOS Interview Questions
  • Web Technologies
  • Database Interview Questions
  • MS Office Interview Questions
  • Software Tools
  • Data Interpretation
  • PHP Interview Questions
  • CAT Mock Test
  • SSC Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy