Which symbol is used for the 'modulo' operation in C?
A. %
B. /
C. *
D. ^
Answer: Option A
Solution(By Examveda Team)
The symbol used for the 'modulo' operation in C is %. The '%' symbol calculates the remainder when one number is divided by another and is commonly used for tasks such as checking for even or odd numbers and cycling through a range of values.So, the correct answer is:
Option A:
%
Here's an example of using the modulo operator in C:
int remainder = 10 % 3;
In this example, the value of 'remainder' will be 1 because 10 divided by 3 is 3 with a remainder of 1.
Related Questions on C Fundamentals
What is the primary purpose of a function prototype in C?
A. Declare a variable
B. Declare a function
C. Define a function
D. Assign a value
What is the correct syntax for declaring a variable in C?
A. int variable_name;
B. variable_name = 5;
C. variable_name int;
D. int = variable_name;
Join The Discussion