0% found this document useful (0 votes)
3 views24 pages

Arithmetic Operator Programming Tasks

The document contains a series of programming questions focused on arithmetic operations and number manipulation, authored by Shambhu Kumar from QSpiders | JSpiders in Noida. Each question provides a specific task related to a given integer, such as printing digits, swapping numbers, calculating profit/loss percentages, and evaluating expressions. The questions are designed to test understanding of basic programming concepts and arithmetic operations.

Uploaded by

Himanshu kumar
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)
3 views24 pages

Arithmetic Operator Programming Tasks

The document contains a series of programming questions focused on arithmetic operations and number manipulation, authored by Shambhu Kumar from QSpiders | JSpiders in Noida. Each question provides a specific task related to a given integer, such as printing digits, swapping numbers, calculating profit/loss percentages, and evaluating expressions. The questions are designed to test understanding of basic programming concepts and arithmetic operations.

Uploaded by

Himanshu kumar
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

QSpiders|JSpiders|PySpiders, NOIDA

B-4, Block-B, Sector-3, Noida


Arithmetic Operator Programming Questions by
Shambhu Sir
@javac_java Monday, 11 August 2025 @kumarsam07

SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Q1
Q:1
For a given number int n=5783;
a. Print the last digit of the number
b. Print the last two digit of the number
c. Remove the last digit of the number
d. Remove the last two digit of the number
8/12/2025 Shambhu Kumar QSpiders | JSpiders, 1
NOIDA
SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q2
For a given number int n=5783;
Print each digit of the number one by one from
Right to Left.
o/p:
3
8
7
5

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 2


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q3
For a given number int n=5783;
Print each digit of the number one by one from
Left to Right.
o/p:
5
7
8
3

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 3


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q4
WAJP to swap two numbers.
a. With using a third variable
b. Without using third variable

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 4


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q5
For the given three numbers. Swap 1st into 2nd,
2nd into 3rd and 3rd into 1st number.
a. With using fourth variable
b. Without using fourth variable

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 5


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q6
For the given CP and SP. Calculate %Profit.
CP=120;
SP=160;

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 6


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q7
For the given CP and SP. Calculate %Loss.
CP=120;
SP=90;

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 7


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q8
Find the Last Digit of a Number Without using
% operator.
Int n=12345;
Output:
5

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 8


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q9
Reverse a 3-Digit Number Using Pure
Arithmetic operator.
Int n=123;
Output:
321

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 9


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q10
Find Sum of three Digit number Without using
Loops
Int n=123;
Output:
6

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 10


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q11
Find Sum of First N Natural Numbers Without
Loop
Int n=100;
1+2+3+…. Upto 100
Output:
5050

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 11


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q12
Find Sum of all odd Numbers up to n Without
Loop
Int n=100;
1+3+5+….upto 100
Output:
2500

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 12


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q13
Find Sum of all even Numbers up to n Without
Loop
Int n=100;
2+4+6+….upto 100
Output:
2550

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 13


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q14
Find Sum of squares of all Numbers up to n
Without Loop
Int n=100;
𝟏𝟐 + 𝟐𝟐 + 𝟑𝟐 + ⋯ … … … … … … . 𝒖𝒑𝒕𝒐 𝟏𝟎𝟎
Output:
2550
8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 14
SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q15
Evaluate the Expression:
int x = 5 / 2 * 2;
[Link](x);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 15


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q16
Evaluate the Expression:
int n = 128;
int rev = (n % 10) * 100 + ((n / 10) % 10) * 10 + (n / 100);
[Link](rev);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 16


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q17
Evaluate the Expression:
int n = 120;
int rev = (n % 10) * 100 + ((n / 10) % 10) * 10 + (n / 100);
[Link](rev);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 17


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q18
Evaluate the Expression:
int x = 1 + 2 * 3 / 4;
[Link](x);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 18


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q19
Evaluate the Expression:
int x = 1 + 2 / 3 * 4;
[Link](x);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 19


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q20
Evaluate the Expression:
int x = 100 / 10 * 2 % 3;
[Link](x);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 20


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q21
Evaluate the Expression:
[Link](0/0);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 21


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q22
Evaluate the Expression:
[Link](0.0/0.0);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 22


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q23
Evaluate the Expression:
[Link](1.0/0.0);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 23


SHAMBHU KUMAR QSpiders |JSpiders, NOIDA

Operator based Programming

Q24
Evaluate the Expression:
[Link](-1.0/0.0);

8/12/2025 Shambhu Kumar @QSpiders, NOIDA Instagram: @javac_java 24

You might also like