C++:Use the Modulus(%) Operator to get reminder
Printer-friendly version
Use the Modulus(%) Operator to get reminder
#include<iostream.h> //Header File for console input and output #include<conio.h> //Header File for getch() void main() { int a,b; a=5; //Initializing the value. b=2; //Use Cin>> to input via Keyboard. int c=a%b; cout<<"When you divide "<<a<<" by "<<b<<" the reminder is "<<c<<"."; getch(); //Press any key to return }
Ouput: When you divide 5 by 2 the reminder is 1.
Similar
- Kopete Google Talk Invisible
- Python vs PHP (webdev)
- Getting Started with C++
- Portable Graphical Programming For Linux and Windows in C++
- C++: Ditch Turbo C++ use Relo !
- Generating Serial Page Numbers in PHP [Pager]
- Adding your META tags on to a drupal page
- Remove your site titles from content pages in Drupal
- PHP: Receiving Function Arguments without declaring any parameters in prototype!
- Extracting Data from a file using cut and grep