0% found this document useful (0 votes)
3 views1 page

1 Variable, Operator, Control

The document outlines beginner exercises focused on data types, variables, operators, control statements, and loops in programming. It includes specific programming tasks such as variable declaration, arithmetic operations, conditional checks, and loop implementations. Each section contains multiple questions aimed at reinforcing fundamental programming concepts.

Uploaded by

shivamverma63970
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 views1 page

1 Variable, Operator, Control

The document outlines beginner exercises focused on data types, variables, operators, control statements, and loops in programming. It includes specific programming tasks such as variable declaration, arithmetic operations, conditional checks, and loop implementations. Each section contains multiple questions aimed at reinforcing fundamental programming concepts.

Uploaded by

shivamverma63970
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/ 1

1.

Data Types & Variables

🔹 Beginner Exercises:
●​ Q1: Declare variables of all primitive data types and print their default values.​

●​ Q2: Write a program to swap two integers using a temporary variable.​

●​ Q3: Write a program to calculate the area and perimeter of a rectangle.​

2. Operators

🔹 Arithmetic, Relational, Logical, and Bitwise:


●​ Q4: Take two numbers and perform all arithmetic operations.​

●​ Q5: Check if a number is even or odd using the modulus operator.​

●​ Q6: Use relational and logical operators to validate a user's age (e.g., age must be 18–60).​

●​ Q7: Write a program to show the effect of bitwise AND, OR, and XOR on two integers.​

3. Control Statements

🔹 If-Else & Switch:


●​ Q8: Write a program to check whether a number is positive, negative, or zero.​

●​ Q9: Take input marks and print grade using if-else:​

○​ 90+ = A, 80–89 = B, 70–79 = C, else = F.​

●​ Q10: Create a calculator using switch-case (operations: +, −, *, /, %).​

●​ Q11: Find the largest of three numbers using nested if-else.​

🔹 Loops (for, while, do-while):


●​ Q12: Print all even numbers from 1 to 100.​

●​ Q13: Print the multiplication table of a given number.​

●​ Q14: Calculate factorial of a number.​

●​ Q15: Check if a number is a palindrome.​

●​ Q16: Print Fibonacci series up to n terms.​

●​ Q17: Count digits in a number.​

●​ Q18: Reverse a number.

You might also like