0% found this document useful (0 votes)
29 views5 pages

Quiz About C Data Types

The document contains a series of programming questions related to C language, focusing on data types, output predictions, and variable declarations. Each question presents a code snippet or concept and offers multiple-choice answers for users to select from. The content is designed for practice and discussion among learners of C programming.

Uploaded by

chandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views5 pages

Quiz About C Data Types

The document contains a series of programming questions related to C language, focusing on data types, output predictions, and variable declarations. Each question presents a code snippet or concept and offers multiple-choice answers for users to select from. The content is designed for practice and discussion among learners of C programming.

Uploaded by

chandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Tutorials

Search... Sign In
Practice
Jobs
DSA Practice Problems C C++ Java Python JavaScript Data Science Machine Learning Courses Linux DevOps SQL Web Develop

C Data Types
Last Updated : Mar 19, 2024 Discuss

Question 1

Predict the output of following program. Assume that the numbers are stored in 2's complement form.

#include<stdio.h>
int main()
{
unsigned int x = -1;
int y = ~0;
if (x == y)
printf("same");
else
printf("not same");
return 0;
}

A same

B not same

Discuss it

Question 2

Which of the following is not a valid declaration in C?

1. short int x;

2. signed short x;

3. short x;

4. unsigned short x;

A 3 and 4

B 2

C 1

D All are valid

Discuss it

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
Question 3 Got It !
acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Predict the output

#include <stdio.h>

int main()
{
float c = 5.0;
printf ("Temperature in Fahrenheit is %.2f", (9/5)*c + 32);
return 0;
}

A Temperature in Fahrenheit is 41.00

B Temperature in Fahrenheit is 37.00

C Temperature in Fahrenheit is 0.00

D Compiler Error

Discuss it

Question 4

Predict the output of following C program

#include <stdio.h>
int main()
{
char a = 012;

printf("%d", a);

return 0;
}

A Compiler Error

B 12

C 10

D Empty

Discuss it

Question 5

In C, sizes of an integer and a pointer must be same.

A True

B False

Discuss it

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Question 6

Output?

int main()
{
void *vptr, v;
v = 0;
vptr = &v;
printf("%v", *vptr);
getchar();
return 0;
}

A 0

B Compiler Error

C Garbage Value

Discuss it

Question 7

Assume that the size of char is 1 byte and negatives are stored in 2's complement form

#include<stdio.h>
int main()
{
char c = 125;
c = c+10;
printf("%d", c);
return 0;
}

A 135

B +INF

C -121

D -8

Discuss it

Question 8

#include <stdio.h>
int main()
{
if (sizeof(int) > -1)
printf("Yes");
else
printf("No");
return 0;
}

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
A Yesacknowledge that you have read and understood our Cookie Policy & Privacy Policy
B No

C Compiler Error

D Runtime Error

Discuss it

Question 9

Output of following program?

#include<stdio.h>
int main()
{
float x = 0.1;
if ( x == 0.1 )
printf("IF");
else if (x == 0.1f)
printf("ELSE IF");
else
printf("ELSE");
}

A ELSE IF

B IF

C ELSE

Discuss it

Question 10

Suppose n and p are unsigned int variables in a C program. We wish to set p to nC3. If n is large, which of the following statements is most
likely to set p correctly?

A p = n * (n-1) * (n-2) / 6;

B p = n * (n-1) / 2 * (n-2) / 3;

C p = n * (n-1) / 3 * (n-2) / 2;

D p = n * (n-1) * (n-2) / 6.0;

Discuss it

Tags: C Quiz

There are 14 questions to complete.


We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Take a part in the ongoing discussion View All Discussion

Company Explore Tutorials DSA Data Science & Web


About Us Job-A-Thon Python Data Structures ML Technologies
Corporate & Communications Legal Offline Java Algorithms Data Science With HTML
Address: Privacy Policy Classroom C++ DSA for Python CSS
Careers Program PHP Beginners
A-143, 7th Floor, Machine Learning JavaScript
Sovereign Corporate In Media DSA in GoLang Basic DSA ML Maths TypeScript
Tower, Sector- 136, Noida, Contact Us JAVA/C++ SQL Problems Data Visualisation ReactJS
Uttar Pradesh (201305) Corporate Master R Language DSA Roadmap Pandas NextJS
Solution System Android DSA Interview
Registered Address: NumPy NodeJs
Campus Design Questions
K 061, Tower K, Gulshan NLP Bootstrap
Training Master CP Competitive
Vivante Apartment, Sector Deep Learning Tailwind CSS
137, Noida, Gautam Buddh Program Videos Programming
Nagar, Uttar Pradesh,
201305 Python Computer DevOps System School Databases
Tutorial Science Git Design Subjects SQL

Python GATE CS AWS High Level Mathematics MYSQL

Examples Notes Docker Design Physics PostgreSQL

Django Operating Kubernetes Low Level Chemistry PL/SQL

Tutorial Systems Azure Design Biology MongoDB

Python Computer GCP UML Diagrams Social Science

Projects Network DevOps Interview Guide English Grammar


Advertise with us Python Database Roadmap Design Patterns
Tkinter Management OOAD
Web Scraping System System Design
OpenCV Software Bootcamp
Tutorial Engineering Interview
Python Digital Logic Questions
Interview Design

Question Engineering
Maths

Preparation More Courses Programming Clouds/Devops GATE 2026


IBM Languages DevOps GATE CS Rank
Corner Tutorials
Certification C Programming Engineering Booster
Company- Software
Courses with Data AWS Solutions GATE DA Rank
Wise Development
DSA and Structures Architect Booster
Recruitment Software
Placements C++ Certification GATE CS & IT
Process Testing
Web Programming Salesforce Course - 2026
Aptitude Product
Development Course Certified GATE DA
Preparation Management
Data Science Java Administrator Course 2026
Puzzles Project
Programming Programming Course GATE Rank
Company- Management
Languages Course Predictor
Wise Linux
DevOps & Python Full
Preparation Excel
Cloud Course
All Cheat
Sheets

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our Cookie Policy & Privacy Policy

You might also like