What will be the output of the following C program?
% and / have same precedence and left to right associativity. So % is performed first which results in 3 and / is performed next resulting in 1. The emphasis is, sign of left operand is appended to result in case of modulus operator in C.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Modulus of two float or double numbers
- C program to invert (making negative) an image content in PGM format
- C program to Check Whether a Number is Positive or Negative or Zero
- How will you print numbers from 1 to 100 without using loop?
- Write a one line C function to round floating point numbers
- How to Count Variable Numbers of Arguments in C?
- To find sum of two numbers without using any operator
- Converting Strings to Numbers in C/C++
- Precision of floating point numbers in C++ (floor(), ceil(), trunc(), round() and setprecision())
- C Program to print numbers from 1 to N without using semicolon?
- Program to print a pattern of numbers
- Add two numbers using ++ and/or --
- Octal numbers in c
- Why variable name does not start with numbers in C ?
- How will you print numbers from 1 to 100 without using loop? | Set-2
- LEX program to add line numbers to a given file
- C Program to Multiply two Floating Point Numbers
- C program to Find the Largest Number Among Three Numbers
- Problem in comparing Floating point numbers and how to compare them correctly?
- Average of Cubes of first N natural numbers
Improved By : sushantgundla