Posts

Showing posts from July, 2023

Test Your Skills on C Operators

Image
Practice Quiz Practice quiz Unlock the power of C programming by taking the quiz and embrace the confidence that comes with mastering this language. Believe in yourself, you've got this! Before start, if you wish to refresh your knowledge on C operators, Click Here 1. What is the output of the following C code? 1 2 3 4 5 6 7 #include <stdio.h> int main () { int x = 5 ; printf( "%d " , x ++ ); printf( "%d" , ++ x); return 0 ; } A) 5 7 B) 6 6 C) 6 7 D) 5 6 Answer The code will print "5 7" as output. The first printf statement prints the value of x (5) and then increments it by 1, and the second printf statement prints the incre

Chapter 4: Deep Dive into Operators in C

Image
Operators in C Operators are symbols in C programming that perform various operations on operands (variables, constants, or expressions). They allow you to manipulate and perform calculations on data. Here are some commonly used operators in C: Arithmetic Operators. Assignment Operators. Relational Operators. Logical Operators. Bitwise Operators. Increment and Decrement Operators. Conditional (Ternary) Operator. 1. Arithmetic Operators: Why? Arithmetic operators allow you to perform mathematical calculations, making your programs more dynamic and flexible. When? You can use arithmetic operators when you need to add, subtract, multiply, divide, or find the remainder between two values. How? For example, you can use the addition operator (+) to add two numbers together. Arithmetic Operators Addition (+) : Adds two operands together. Subtraction (-): Subtracts the second operand from the first. Multiplication (*): Multiplies two operands. Division (/): Divides the first operand by th