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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Modulus of two float or double numbers
- C program to Check Whether a Number is Positive or Negative or Zero
- C program to invert (making negative) an image content in PGM format
- Add two numbers using ++ and/or --
- Octal numbers in c
- Converting Strings to Numbers in C/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
- To find sum of two numbers without using any operator
- How will you print numbers from 1 to 100 without using loop?
- Program to print a pattern of numbers
- C Program to print numbers from 1 to N without using semicolon?
- Average of Cubes of first N natural numbers
- LEX program to add line numbers to a given file
- How to Count Variable Numbers of Arguments in C?
- C program to Find the Largest Number Among Three Numbers
- C Program to Multiply two Floating Point Numbers
- Print numbers in sequence using thread synchronization
- Problem in comparing Floating point numbers and how to compare them correctly?
- Write a one line C function to round floating point numbers
Improved By : sushantgundla