[go: up one dir, main page]

0% found this document useful (0 votes)
45 views6 pages

Quiz About C Operators

The document contains a series of C programming questions designed to test knowledge of operators and expressions. Each question presents a code snippet with multiple-choice answers regarding the expected output or behavior of the code. The questions cover various topics such as variable assignment, function calls, and operator precedence.

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)
45 views6 pages

Quiz About C Operators

The document contains a series of C programming questions designed to test knowledge of operators and expressions. Each question presents a code snippet with multiple-choice answers regarding the expected output or behavior of the code. The questions cover various topics such as variable assignment, function calls, and operator precedence.

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/ 6

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 Operators
Last Updated : Jan 19, 2024 Discuss

Question 1

#include <stdio.h>

int main()
{
int i = 1, 2, 3;

printf("%d", i);

return 0;
}

A 1

B 3

C Garbage value

D Compile time error

Discuss it

Question 2

#include <stdio.h>

int main()
{
int i = (1, 2, 3);

printf("%d", i);

return 0;
}

A 1

B 3

C Garbage value

D Compile time error


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

#include <stdio.h>

int main()
{
int i;

i = 1, 2, 3;
printf("%d", i);

return 0;
}

A 1

B 3

C Garbage value

D Compile time error

Discuss it

Question 4

#include <stdio.h>
int main()
{
int i = 5, j = 10, k = 15;
printf("%d ", sizeof(k /= i + j));
printf("%d", k);
return 0;
}

Assume size of an integer as 4 bytes. What is the output of above program?

A 41

B 4 15

C 21

D Compile-time error

Discuss it

Question 5

#include <stdio.h>
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
int main()
{ acknowledge that you have read and understood our Cookie Policy & Privacy Policy
//Assume sizeof character is 1 byte and sizeof integer is 4 bytes
printf("%d", sizeof(printf("GeeksQuiz")));
return 0;
}

A GeeksQuiz4

B 4GeeksQuiz

C GeeksQuiz9

D 4

E Compile-time error

Discuss it

Question 6

Output of following program?

#include <stdio.h>
int f1() { printf ("Geeks"); return 1;}
int f2() { printf ("Quiz"); return 1;}

int main()
{
int p = f1() + f2();
return 0;
}

A GeeksQuiz

B QuizGeeks

C Compiler Dependent

D Compiler Error

Discuss it

Question 7

What is the output of following program?

#include <stdio.h>

int main()
{
int a = 1;
int b = 1;
int c = a || --b;
int d = a-- && --b;
printf("a = %d, b = %d, c = %d, d = %d", a, b, c, d);
return 0;
}

A a = 0, b = 1, c = 1, d = 0
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
B a = 0, b = 0, c = 1, d = 0

C a = 1, b = 1, c = 1, d = 1

D a = 0, b = 0, c = 0, d = 0

Discuss it

Question 8

#include <stdio.h>
int main()
{
int a = 10, b = 20, c = 30;
if (c > b > a)
printf("TRUE");
else
printf("FALSE");
return 0;
}

A TRUE

B FALSE

C Compiler Error

D Output is compiler dependent

Discuss it

Question 9

#include<stdio.h>
int main()
{
char *s[] = { "knowledge","is","power"};
char **p;
p = s;
printf("%s ", ++*p);
printf("%s ", *p++);
printf("%s ", ++*p);

return 0;
}

A is power

B nowledge nowledge s

C is ower

D nowledge knowledge is

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 10

#include<stdio.h>
int main(void)
{
int a = 1;
int b = 0;
b = a++ + a++;
printf("%d %d",a,b);
return 0;
}

A 36

B Compiler Dependent

C 34

D 33

Discuss it

Tags: C Quiz

There are 40 questions to complete.

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
We use cookieswith us
to ensure you have the best browsing experience on ourRoadmap
website. By using our site, you
Python Design Patterns
acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Tkinter OOAD
Web Scraping Database System Design
OpenCV Management Bootcamp
Tutorial System Interview
Python Software Questions
Interview Engineering
Question Digital Logic
Design
Engineering
Preparation More Courses Programming Clouds/Devops GATE 2026
Maths IBM DevOps
Corner Tutorials Languages GATE CS Rank
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