In C language, operators are categorized into six main categories - arithmetic, relational, logical, bitwise, assignment, and ternary. Arithmetic operators perform basic mathematical operations like addition, subtraction etc. Relational operators compare two expressions and return 0 or 1. Logical operators combine two or more operands. Bitwise operators operate on bits of operands. Assignment operators assign values to operands. Ternary operators use the ?: syntax to evaluate conditional expressions.
Arithmetic Operator - Basic C Programming Solve
Problems…
1. (a) Write a program that read two integer and display sum.
(b) Write a program that read two floating point and display sum.
2. Write a program that subtracts two integer.
3. Write a program that read two integer and display product.
4. (a) Write a program that divide two integer.
(b) Write a program that divide two floating point
5. Write a program that read two integer and display reminder.
6. Write a program that read radius of a circle and display its area.
7. Write a program to demonstrate the working of increment and decrement operators.
SOLVED BY
Md. Masudur Rahman
Department of Textile Engineering
4th Batch
National Institute of Textile Engineering and Research (NITER)
masudbdasia@gmail.com
Operator : Operators in C program is special symbol or word which directs the compiler to perform arithmetical or logical works, i.e. the characters which is used in C for special purpose so this character is called operators.
Different types of operators :
* Arithmetic operator
* Unary operator
* Relational operator
* Logical operator
Arithmetic
Operators niterians.blogspot.com
Operator
Meaning
+
Addition or unary plus
-
Subtraction or unary minus
*
Multiplication
/
Division
%
Modulo division
++
Increment operator increases the integer value
by one.
--
Decrement operator decreases the integer
value by one.
* Assignment operator
* Conditional operator
* Arithmetic Operators List :
* Arithmetic expressions:
An arithmetic expression is a combination of variables, constants, and operators.
For example,
(1) (b) Write a program that read two floating point and display sum.
2) Write a program that subtracts two integer.
2) Write a program that subtracts two integer
3) Write a program that read two integer and display product.
(4) (a) Write a program that divide two integer.
(4) (b) Write a program that divide two floating point
(4) (b) Write a program that divide two floating point
5) Write a program that read two integer and display reminder.
(6) (a) Write a program that read radius of a circle and display its area.
(6) (b) Write a program that read radius of a circle and display its area
(6) (b) Write a program that read radius of a circle and display its area
(6) (c) Write a program that read radius of a circle and display its area
7) Write a program to demonstrate the working of increment and decrement operators.
Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Arithmetic Operator - Basic C Programming Solve
Problems…
1. (a) Write a program that read two integer and display sum.
(b) Write a program that read two floating point and display sum.
2. Write a program that subtracts two integer.
3. Write a program that read two integer and display product.
4. (a) Write a program that divide two integer.
(b) Write a program that divide two floating point
5. Write a program that read two integer and display reminder.
6. Write a program that read radius of a circle and display its area.
7. Write a program to demonstrate the working of increment and decrement operators.
SOLVED BY
Md. Masudur Rahman
Department of Textile Engineering
4th Batch
National Institute of Textile Engineering and Research (NITER)
masudbdasia@gmail.com
Operator : Operators in C program is special symbol or word which directs the compiler to perform arithmetical or logical works, i.e. the characters which is used in C for special purpose so this character is called operators.
Different types of operators :
* Arithmetic operator
* Unary operator
* Relational operator
* Logical operator
Arithmetic
Operators niterians.blogspot.com
Operator
Meaning
+
Addition or unary plus
-
Subtraction or unary minus
*
Multiplication
/
Division
%
Modulo division
++
Increment operator increases the integer value
by one.
--
Decrement operator decreases the integer
value by one.
* Assignment operator
* Conditional operator
* Arithmetic Operators List :
* Arithmetic expressions:
An arithmetic expression is a combination of variables, constants, and operators.
For example,
(1) (b) Write a program that read two floating point and display sum.
2) Write a program that subtracts two integer.
2) Write a program that subtracts two integer
3) Write a program that read two integer and display product.
(4) (a) Write a program that divide two integer.
(4) (b) Write a program that divide two floating point
(4) (b) Write a program that divide two floating point
5) Write a program that read two integer and display reminder.
(6) (a) Write a program that read radius of a circle and display its area.
(6) (b) Write a program that read radius of a circle and display its area
(6) (b) Write a program that read radius of a circle and display its area
(6) (c) Write a program that read radius of a circle and display its area
7) Write a program to demonstrate the working of increment and decrement operators.
Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Programs are complete in best of my knowledge with zero compilation error in IDE Bloodshed Dev-C++. These can be easily portable to any versions of Visual Studio or Qt. If you need any guidance please let me know via comments and Always Enjoy Programming.
The aptitude test consisted tricky questions on core subjects of CSE like C , C++, Java ,Data Structures, Database, Computer Networks, Theory of Computation.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Programs are complete in best of my knowledge with zero compilation error in IDE Bloodshed Dev-C++. These can be easily portable to any versions of Visual Studio or Qt. If you need any guidance please let me know via comments and Always Enjoy Programming.
The aptitude test consisted tricky questions on core subjects of CSE like C , C++, Java ,Data Structures, Database, Computer Networks, Theory of Computation.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Automobile Management System Project Report.pdfKamal Acharya
The proposed project is developed to manage the automobile in the automobile dealer company. The main module in this project is login, automobile management, customer management, sales, complaints and reports. The first module is the login. The automobile showroom owner should login to the project for usage. The username and password are verified and if it is correct, next form opens. If the username and password are not correct, it shows the error message.
When a customer search for a automobile, if the automobile is available, they will be taken to a page that shows the details of the automobile including automobile name, automobile ID, quantity, price etc. “Automobile Management System” is useful for maintaining automobiles, customers effectively and hence helps for establishing good relation between customer and automobile organization. It contains various customized modules for effectively maintaining automobiles and stock information accurately and safely.
When the automobile is sold to the customer, stock will be reduced automatically. When a new purchase is made, stock will be increased automatically. While selecting automobiles for sale, the proposed software will automatically check for total number of available stock of that particular item, if the total stock of that particular item is less than 5, software will notify the user to purchase the particular item.
Also when the user tries to sale items which are not in stock, the system will prompt the user that the stock is not enough. Customers of this system can search for a automobile; can purchase a automobile easily by selecting fast. On the other hand the stock of automobiles can be maintained perfectly by the automobile shop manager overcoming the drawbacks of existing system.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
1. Operators in ‘C’
In C language, operators are categorized in following six categories :
Arithmetic: Perform basic mathematical operations over one or more than one operands.
Relational and Logical operator: Relational operators are used to compare two
expressions and return the value as 0 and 1. Logical operator combines two or more
operands.
Bitwise: Bitwise operator operates at bit level..
Assignment Operator: Assigns value.
Technical Training (C Basics)
2. Operators in ‘C’
Simplest meaning of operator is which works on operand.
Arithmetic:
Perform basic mathematical operations on operands.
1-Unary Operator (one operand)
2-Binary Operator (two operand)
Unary Operator (one operand)
Increment- The ++ operator is used to increment the value of integer.
a++ post increment ++a pre increment
Decrement- The -- operator is used to decrement the value of integer.
a-- post decrement --a pre decrement
Technical Training (C Basics)
3. Operator Definition Example Unary or Binary
+ adds two operands a+b binary
- Subtracts second operands from first. a-b binary
* multiply two operands a*b binary
/ Divides numerator by denominator. a/b binary
% Gives remainder after an integer division. a%b binary
++ Increase an integer value by one. ++a , a++ unary
-- Decrease an integer value by one. --a , a-- unary
Technical Training (C Basics)
4. What would be the output of the above code ? Choose
the correct option.
A. 1.0 B. 5.0
C. 2.0 D. Error
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
float a=5.0,b=2.0,c;
c=a % b;
printf("%f",c);
return 0;
}
5. What would be the output of the above code ? Choose
the correct option.
A. 1.0 B. 5.0
C. 2.0 D. Error
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
float a=5.0,b=2.0,c;
c=a % b;
printf("%f",c);
return 0;
}
6. What would be the output of the above code ? Choose
the correct option.
A. 22 B. 32
C. 24 D. 30
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5,b=2,c;
c=a++ + ++b + b++ + ++a + a++ + ++b;
printf("%d",c);
return 0;
}
7. What would be the output of the above code ? Choose
the correct option.
A. 22 B. 32
C. 24 D. 30
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5,b=2,c;
c=a++ + ++b + b++ + ++a + a++ + ++b;
printf("%d",c);
return 0;
}
8. What would be the output of the above code ? Choose
the correct option.
A. 22 B. 12
C. 24 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5,b=3,c;
c=a-- + --a + b-- + --b + --b + --a;
printf("%d",c);
return 0;
}
9. What would be the output of the above code ? Choose
the correct option.
A. 22 B. 12
C. 24 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5,b=3,c;
c=a-- + --a + b-- + --b + --b + --a;
printf("%d",c);
return 0;
}
10. What would be the output of the above code ? Choose
the correct option.
A. 7 7 6 B. 5 7 8
C. 5 6 7 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5;
printf("%d%d%d",a++,++a,++a);
return 0;
}
11. What would be the output of the above code ? Choose
the correct option.
A. 7 7 6 B. 5 7 8
C. 5 6 7 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main(void)
{
int a=5;
printf("%d%d%d",a++,++a,++a);
return 0;
}
12. What would be the output of the above code ? Choose
the correct option.
A. 4 B. error
C. 5 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main()
{
int i = 3;
printf("%d", (++i)++);
return 0;
}
13. What would be the output of the above code ? Choose
the correct option.
A. 4 B. error
C. 5 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main()
{
int a = 4;
printf("%d", (++a)++);
return 0;
}
14. Bitwise Operator: In C bitwise operator works at bit level.
Operator Definition
& Bitwise And
| Bitwise Or
^ Bitwise XOR
~ Bitwise NOT
>> Right Shift Operator
<< Left Shift Operator
Technical Training (C Basics)
15. Bitwise Operator:
points to remember-
1.Left and right shift operators should not be used for negative numbers.
2.if the number is shifted more than the size of integer the behavior is undefined.
3.The bitwise operator should not be used in place of logical operators.
Technical Training (C Basics)
16. What would be the output of the above code ? Choose
the correct option.
A. 4 B. error
C. 5 D. Compiler
dependent
Technical Training (C Basics)
#include <stdio.h>
int main()
{
int i = 3;
printf("%d", (++i)++);
return 0;
}
17. Operators in ‘C’
In C language, operators are categorized in following six categories :
Logical Operator: Perform basic mathematical operations over one or more than one
operands.
Operator Definition
&& Logical And
|| Logical Or
Technical Training (C Basics)
18. Operators in ‘C’
In C language, operators are categorized in following six categories :
Assignment Operator:
It is a binary Operator
Evaluates the operator on Right side and assigns it to on Left side.
Example
Technical Training (C Basics)
19. Operators in ‘C’
In C language, operators are categorized in following six categories :
Operators Type Associativity
() [] -> . Left to right
! ~ ++ -- + - * & (type) sizeof Unary Right to left
* / % Binary Left to right
+ - Binary Left to right
<< >> Binary Left to right
< <= > >= Binary Left to right
== != Binary Left to right
& Binary Left to right
^ Binary Left to right
| Binary Left to right
&& Binary Left to right
|| Binary Left to right
?: Binary Right to left
= += -= *= /= %= &= |= ^= >>= <== Binary Right to left
, Binary Left to right
Technical Training (C Basics)
20. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
int a = 2;
int a;
int main(void) {
printf("%d", a);
int a;
for(int i = 0 ; i < 3 ; i++ )
{
printf("%d", a);
a++;
}
printf("%d", a);
return 0;
}
What would be the output of the above code ? Choose
the correct option.
A. 2 0 1 2 3 B. 2 2 2 2 3
C. 2 1 1 2 2 D. Compiler error
Technical Training (C Basics) TCS
21. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
int a = 2;
int a;
int main(void) {
printf("%d", a);
int a;
for(int i = 0 ; i < 3 ; i++ )
{
printf("%d", a);
a++;
}
printf("%d", a);
return 0;
}
What would be the output of the above code ? Choose
the correct option.
A. 2 0 1 2 3 B. 2 2 2 2 3
C. 2 1 1 2 2 D. Compiler error
Technical Training (C Basics) TCS
22. 1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>
int a = 12;
int main(void) {
for(int j = 0; j <= 1; j++)
{
int a = 4;
a++;
}
printf("%d" , a);
return 0;
}
What would be the output of the above code ? Choose
the correct option.
A. 4 B. 12
C. 5 D. Compiler error
Technical Training (C Basics) Capegemini
23. 1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>
int a = 12;
int main(void) {
for(int j = 0; j <= 1; j++)
{
int a = 4;
a++;
}
printf("%d" , a);
return 0;
}
What would be the output of the above code ? Choose
the correct option.
A. 4 B. 12
C. 5 D. Compiler error
Technical Training (C Basics) Capegemini
24. 1
2
3
4
5
6
7
8
9
10
What would be the output of the above code ? Choose
the correct option.
A. 4 B. 5
C. 6 D. Error
#include <stdio.h>
int main(void) {
for(int i = 0; i < 2; i++)
{
static int a = 4;
a++;
}
printf("%d", a);
return 0;
}
Technical Training (C Basics) TCS
25. 1
2
3
4
5
6
7
8
9
10
What would be the output of the above code ? Choose
the correct option.
A. 4 B. 5
C. 6 D. Error
#include <stdio.h>
int main(void) {
for(int i = 0; i < 2; i++)
{
static int a = 4;
a++;
}
printf("%d", a);
return 0;
}
Technical Training (C Basics) TCS
26. 1
2
3
4
5
6
7
8
9
10
11
12
13
What would be the output of the above code ? Choose
the correct option.
A. 0 1 B. 2 3
C. 3 4 D. Error
#include <stdio.h>
int a;
int main(void) {
{
a = 2;
}
for(int i = 0; i < 2; i++)
{
a++ ;
printf("%d " , a);
}
return 0 ;
}
Technical Training (C Basics) Capegemini
27. 1
2
3
4
5
6
7
8
9
10
11
12
13
What would be the output of the above code ? Choose
the correct option.
A. 0 1 B. 2 3
C. 3 4 D. Error
#include <stdio.h>
int a;
int main(void) {
{
a = 2;
}
for(int i = 0; i < 2; i++)
{
a++ ;
printf("%d " , a);
}
return 0 ;
}
Technical Training (C Basics) Capegemini
28. 1
2
3
4
5
6
7
8
9
10
11
12
What would be the output of the above code ? Choose
the correct option.
A. 1 10 0 B. 1 10 1
C. 1 10 10 D. Error
#include <stdio.h>
int main(void) {
int x = 1 ;
printf("%d", x ); {
int x = 10;
printf("%d", x ); {
x;
printf("%d", x );
}
}
return 0;
}
Technical Training (C Basics) Infosys
29. 1
2
3
4
5
6
7
8
9
10
11
12
What would be the output of the above code ? Choose
the correct option.
A. 1 10 0 B. 1 10 1
C. 1 10 10 D. Error
#include <stdio.h>
int main(void) {
int x = 1 ;
printf("%d", x ); {
int x = 10;
printf("%d", x ); {
x;
printf("%d", x );
}
}
return 0;
}
Technical Training (C Basics) Infosys
30. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
What would be the output of the above code ? Choose
the correct option.
A. 20 20 B. 30 20
C. 10 20 D. 20 30
# include<stdio.h>
int a = 10;
int main(void) {
{
a = 30;
{
{
a = 20;
printf("%d", a);
}
}
printf("%d", a);
}
return 0;
}
Technical Training (C Basics) Accenture
31. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
What would be the output of the above code ? Choose
the correct option.
A. 20 20 B. 30 20
C. 10 20 D. 20 30
# include<stdio.h>
int a = 10;
int main(void) {
{
a = 30;
{
{
a = 20;
printf("%d", a);
}
}
printf("%d", a);
}
return 0;
}
Technical Training (C Basics) Accenture
32. 1
2
3
4
5
6
What would be the output of the above code ? Choose
the correct option.
A. 28 B. 25
C. 29 D. 30
#include<stdio.h>
int main(void) {
int a = 7;
int s = a++ + ++a + a-- + a % 2;
printf("%d", s);
}
Technical Training (C Basics) TCS
33. 1
2
3
4
5
6
What would be the output of the above code ? Choose
the correct option.
A. 28 B. 25
C. 29 D. 30
#include<stdio.h>
int main(void) {
int a = 7;
int s = a++ + ++a + a-- + a % 2;
printf("%d", s);
}
Technical Training (C Basics) TCS
34. 1
2
3
4
5
6
7
8
9
What would be the output of the above code ? Choose
the correct option.
A. 2 1 1 B. 3 2 1
C. 3 1 1 D. 2 2 1
#include<stdio.h>
int main(void) {
int i = 1, j = 2, k, l = 1;
{
k = i++ + ++i + j || l++;
printf("%d %d %d", i, l, k);
}
return 0;
}
Technical Training (C Basics) Capegemini
35. 1
2
3
4
5
6
7
8
9
What would be the output of the above code ? Choose
the correct option.
A. 2 1 1 B. 3 2 1
C. 3 1 1 D. 2 2 1
#include<stdio.h>
int main(void) {
int i = 1, j = 2, k, l = 1;
{
k = i++ + ++i + j || l++;
printf("%d %d %d", i, l, k);
}
return 0;
}
Technical Training (C Basics) Capegemini
36. 1
2
3
4
5
6
What would be the output of the above code ? Choose
the correct option.
A. 3 B. 4
C. 2 D. 1
#include <stdio.h>
int main(void) {
int a = 5;
int s = a-- || a-- && 4;
printf("%d", s);
}
Technical Training (C Basics) Infosys
37. 1
2
3
4
5
6
What would be the output of the above code ? Choose
the correct option.
A. 3 B. 4
C. 2 D. 1
#include <stdio.h>
int main(void) {
int a = 5;
int s = a-- || a-- && 4;
printf("%d", s);
}
Technical Training (C Basics) Infosys
38. 1
2
3
4
5
6
7
8
9
What would be the output of the above code ? Choose
the correct option.
A. 1 0 2 B. 1 1 3
C. 2 0 3 D. 2 1 2
#include<stdio.h>
int main(void) {
int i = 0, j = 2, k, l = 0;
{
k = (i++ && l++ ) || j++ + i++;
printf("%d %d %d", i, l, j);
}
return 0;
}
Technical Training (C Basics) Accenture
39. 1
2
3
4
5
6
7
8
9
What would be the output of the above code ? Choose
the correct option.
A. 1 0 2 B. 1 1 3
C. 2 0 3 D. 2 1 2
#include<stdio.h>
int main(void) {
int i = 0, j = 2, k, l = 0;
{
k = (i++ && l++ ) || j++ + i++;
printf("%d %d %d", i, l, j);
}
return 0;
}
Technical Training (C Basics) Accenture
40. 1
2
3
4
5
6
7
8
9
10
What would be the output of the above code ? Choose
the correct option.
A. 4 5 B. 4 4
C. 5 4 D. 5 5
#include<stdio.h>
int main(void) {
int i = 10, j = 10;
int k = 4;
{
printf("%d", sizeof(k /= i+j));
printf("%d", k) ;
}
return 0;
}
Technical Training (C Basics) Infosys
41. 1
2
3
4
5
6
7
8
9
10
What would be the output of the above code ? Choose
the correct option.
A. 4 5 B. 4 4
C. 5 4 D. 5 5
#include<stdio.h>
int main(void) {
int i = 10, j = 10;
int k = 4;
{
printf("%d", sizeof(k /= i+j));
printf("%d", k) ;
}
return 0;
}
Technical Training (C Basics) Infosys