Write a C program to calculate modulus of a number / two numbers.
int main() {
int num1, num2;
/* get the first input from the user */
printf("Enter the value for first number:");
scanf("%d", &num1);
/* find the modulus for num1 */
printf("|%d| = ", num1);
if (num1 < 0) {
num1 = num1 * (-1);
}
printf("%d\n", num1);
printf("Enter the value for second number:");
scanf("%d", &num2);
/* find the modulus for num2 */
printf("|%d| = ", num2);
if (num2 < 0) {
num2 = num2 * (-1);
}
printf("%d\n", num2);
/* find num1 modulo num2 */
printf("%d modulo %d is %d\n", num1, num2, num1 % num2);
return 0;
}
Output:
jp@jp-VirtualBox:~/$ ./a.out
Enter the value for first number:-100
|-100| = 100
Enter the value for second number:-93
|-93| = 93
100 modulo 93 is 7
Enter the value for first number:-100
|-100| = 100
Enter the value for second number:-93
|-93| = 93
100 modulo 93 is 7
See Also:
- c program to print "Hello World"
- c program to print "Hello World" without using semicolon
- c program to swap two numbers
- c program to convert Celsius to Fahrenheit
- c program to convert Fahrenheit to Celsius
- c program to convert time in Hours:Minutes:Seconds to seconds
- c program to find the area of triangle given three sides
- c program to calculate Simple Interest
- c program to print multiplication table from 1 to n
- c program to check whether the given year is leap year or not
- c program to find the size of basic data types
- c program to find the area and circumference of a circle
- c program to find the roots of a quadratic equation
- c program to add two numbers
- c program to swap two numbers without using temporary variable
- c program to check whether the given number N is divisible by M
- c program to add two fractions
- c program to add two numbers without third variable
- c program to convert improper fraction to mixed fraction
- c program to convert centimeters to inches and feet
- c program to convert feet to inches
- c program to convert days into months and days
- c program to convert kilometers to miles, meters and feet
- c program to convert kilometer per hour to meter per second
- c program to convert kilograms to pounds and grams
- c program to convert minutes into hours
- c program to convert time in seconds to hours, minutes and seconds
- c program to convert hours, minutes to seconds
- c program to convert meter to feet and centimeters
- c program to convert plain to cipher text and cipher to plain text
- c program to convert pounds to kilograms
- c program to convert radians to degrees
- c program to convert year to roman equivalent
- c program to calculate compound interest
- c program to calculate power of a number
- c program to calculate factorial
- c program to find the area & perimeter of a circle, triangle, square and rectangle
- c program to calculate age in years, months and days
- c program to find absolute value of a given number
- c program to calculate age from date of birth
- c program to calculate body mass index
- c program to calculate distance between two points
- c program to calculate Greatest Common Divisor(GCD)
- c program to calculate Highest Common Factor(HCF)
- c program to calculate Least Common Multiple(LCM)
- c program to simplify the given fraction using GCF
- c program to calculate Gross and net salary of an employee
- c program to calculate Grades
- c program to calculate GPA
- c program to calculate income tax
- c program to calculate modulus
- c program to implement digital clock
- c program to calculate profit and loss
- c program to calculate percentage
- c program to calculate PI, resistance and power
- c program to calculate square root and square of a number
- c program to calculate volume of a cylinder and sphere
- c program to calculate weighted arithmetic mean
- c program to calculate x power y
- c program to check whether a date is valid or not
- c program to convert days into years, months and weeks
- c program to print date and sleep for a given time
- c program to clear screen and authenticate user
- c program to calculate generic root of any number
- c program to find largest digit of a number
- c program to generate multiplication table for the given number
- c program to convert decimal to binary and count the number of ones and zeros
- c program to round a number
- c program to guess a random number
- c program to implement ceaser cipher
- c program to swap nibble in a byte
- c program to find slope
- c program to calculate nCr and nPr
- c program to print even, odd and prime factors of a given number
- c program to print the four digit numbers whose sum of squares of first half and second half of the number equals the same number
- c program to check whether a given number is magic number or not
- c program to calculate correlation coefficient
hello these are good programs
ReplyDeleteThe increasing importance of technology in every industry continues to drive the need for a diverse group of qualified professionals to manage the implementation and changes in technology. Pursuing a degree at a technology management graduate school can be the right step for beginning a rewarding career in the management of everything from computer hardware to information security within an organization. Overview of Technology Management Technology management professionals are in high demand because of the unique set of skills they possess. antminer u3 setup guide
ReplyDeleteTechnology is vital to the existence and competitive edge of any company. I believe that's the great understatement of the year. Look at what technology allows us to do as compared to 30 years ago; now think back about five years, we've come a long way. tiger shark pool cleaner
ReplyDeleteTechnology is vital to the existence and competitive edge of any company. I believe that's the great understatement of the year. Look at what technology allows us to do as compared to 30 years ago; now think back about five years, we've come a long way. kg to stone converter
ReplyDeleteAll computer consultants are not created equal. Some specialize in hardware, others in software but what you really need is one that specializes in business and how technology can make it better. You need a business technology coach that can help you work smarter with technology. Durometer
ReplyDeleteกำจัดปลวกเชียงใหม่ ( chiangmai termite ) เป็นบริษัทกำจัดปลวกเชียงใหม่ ฉีดปลวกเชียงใหม่ราคาถูก เน้นความคุ้มค่า เพื่อลดค่าใช้จ่ายของลูกค้า. มีขั้นตอนการฉีดปลวกเหมือนกับบริษัทใหญ่ราคาแพง. ปลวกเชียงใหม่
ReplyDeleteThe ceiling fan industry has gone though some dramatic changes and still needs to change to keep up with reduced demand and rising costs. Here is a brief history of the ceiling fan story in America and where it may be going. Not just about fans, this article is relevant to the overall small manufacturing business in America. best ceiling fan high speed
ReplyDeleteWhat City is this you ask? Houston, and not only is Houston going green, this great city has become a technology mecca with many web hosting firms developing strong relationships in the city. best web hosting reviews 2020
ReplyDeleteWere already on the modern technology and it's good to have this kind of articles to know more about other things that we could link into it
ReplyDeleteTennessee temperature test chamber Center at Nashville is one of the 26 technology centers established in the year 1963. The technology center excels in offering technical training programs in various fields.
ReplyDeleteOver the years, cooling bulk solids such as sugar, fertilizer, chemicals, plastics, dried biosolids, minerals, and many other types of grains, crystals and bulk powders using the traditional technologies does not guarantee quality final products. As a result, the business productivity was greatly affected and most of all this technology has lots of disadvantages to deal with. Carding Forum
ReplyDeleteOver the years, cooling bulk solids such as sugar, fertilizer, chemicals, plastics, dried biosolids, minerals, and many other types of grains, crystals and bulk powders using the traditional technologies does not guarantee quality final products. As a result, the business productivity was greatly affected and most of all this technology has lots of disadvantages to deal with. where to buy
ReplyDeleteIntroduction - Imagine an enterprise software development project where the customer says "we are going to take a long time to get this done and we don't expect to see any results for at least two years". Can you imagine it? Me neither, and the truth is that it will probably never happen:) So what is reality? South Melbourne Hypnotherapy
ReplyDeleteIn 1997 Mr. Clayton M.Christensen ( A Harvard Business School Professor ) introduces a new term "Disruptive Technology". He also describes that displaces an established technology. electricians tool belt
ReplyDeleteTechnology-enabled solutions are intangible sales. People don't buy the machine; they buy what it enables. Average sales people tend to perceive technology as a tangible, so they focus on the functionality. Exceptional sales people understand that customers only care about the results the technology enables, which is intangible. This difference in perception about the nature of technology is the fundamental factor in determining a sales person's success. lg v20 wireless charging
ReplyDeleteOver the years, cooling bulk solids such as sugar, fertilizer, chemicals, plastics, dried biosolids, minerals, and many other types of grains, crystals and bulk powders using the traditional technologies does not guarantee quality final products. As a result, the business productivity was greatly affected and most of all this technology has lots of disadvantages to deal with. Xender For PC
ReplyDeleteFollowpc about technology related best apps for PC windows and Mac and we will guide you to How to use and How to install. our team will instruction to you. How to get rid of split screen on ipad
ReplyDeleteOver the years, cooling bulk solids such as sugar, fertilizer, chemicals, plastics, dried biosolids, minerals, and many other types of grains, crystals and bulk powders using the traditional technologies does not guarantee quality final products. As a result, the business productivity was greatly affected and most of all this technology has lots of disadvantages to deal with. best supplies
ReplyDeleteThis website is my breathing in, real fantastic design and perfect content . Nicolas Krafft L'Oreal news
ReplyDeleteThis question has been in the minds of most folks. In the midst of the uprising technology advances we are also faced with lots of negative effects we see today. This question is actually related with life and medicine as technology has solved a lot of our health problems in the past that was almost impossible to deal with. Gilbert Masonry
ReplyDeleteIf it behaves like a drug, and possesses the same characteristics of a drug, then it may very well be a... As many of you know, I have discussed the adverse effects of technology on numerous occasions. Specifically, I am talking about such things as mobile phones, video games, tablets and personal computers, those devices we embrace in the daily affairs of our lives. fuel fixer
ReplyDeletePretty section of content. I just stumbled upon your website and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I’ll be subscribing to your feeds and even I achievement you access consistently fast. https://cheapsoft4you.com/
ReplyDeletePretty section of content. I just stumbled upon your website and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I’ll be subscribing to your feeds and even I achievement you access consistently fast. 먹튀커뮤니티
ReplyDeleteAn explanation in simple terms of 2G and 3G Technology and what they mean for you in today's world. You will see how 3G Phones offer fantastic features including photo-editing, movie presentations and the World Wide Web. You can keep in touch with your friends with digital photos and other communications. route optimize
ReplyDeletePretty section of content. I just stumbled upon your website and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I’ll be subscribing to your feeds and even I achievement you access consistently fast. 먹튀사이트
ReplyDeleteIts like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but other than that, this is excellent blog. A fantastic read. I will definitely be back. 먹튀사이트
ReplyDeleteIf you are looking for a career that can be both physically and financially rewarding, you may want to consider a position in the construction industry. There are many types of positions in the construction industry. decoracion zaragoza
ReplyDeleteNow that you have decided to get yourself a mountain bike, the next thing you should know is that there are so many different types of bikes to suit different types of needs. There is no one fits all here. There are at least 5 different types of bikes, and each bike is designed to tackle different types or terrains and obstacles with its own advantages and disadvantages. Before buying your mountain bike, it best to know where you will be riding and what types of obstacles will you encounter on your rides. This will ultimately help you to decide on the best mountain bike for your usage. Best Electric Bikes
ReplyDeleteHave you ever wondered what attracted you in a new iPad, new smartphone, or any other modern gadget? Was it its fascinating technology or its simplicity of design? Design has become an essential communication tool and it's hard to imaging new technology without it. best Surveillance system cctv
ReplyDeleteHave you ever wondered what attracted you in a new iPad, new smartphone, or any other modern gadget? Was it its fascinating technology or its simplicity of design? Design has become an essential communication tool and it's hard to imaging new technology without it. cheap access control system
ReplyDeleteIt is no secret that there is a secret behind technology blogging; it is one of the best niches in blogging. Blogging about technology is one of the best ways to get ahead in modern society. In fact, technology blogging is the best niche in blogging these days for anyone who wants to start up a successful business. this is very helpful to buy mitsubishi forklift
ReplyDeleteI found your website through a random stroke of luck. It helped me do my research on this topic. Its amazing to think one site could contain so muck information. You are doing the great work! live 22
ReplyDeleteHaving the potential to turn the sails in favour of neophytes and bring down incumbents, Digital Disruption is reshaping markets with the speed and force that has no match in history! Survivors are those businesses that are pro-actively adopting digital, but in order to thrive, they must also innovate new business models to keep pace with the digital age! Corporate Investigator Oakville
ReplyDeleteTechnology is generally defined as the practical application of scientific knowledge in the commercial and industrial field. Have you ever tried to imagine how the business world would function without technology? Everybody will agree that technology is indeed essential for all businesses whether they are small or large. Teletalk offer 2021
ReplyDeleteWhen it comes to purchasing large machinery, prices can be sky high. However, quality is always something to be considered. Here are a few tips to consider when purchasing larger machinery, especially Sand Mixers. read here
ReplyDeleteFew people today realize how complex the process of accurate medical billing has become. It is critical that both doctors and those looking for employment as medical billing workers understand the advantages and disadvantages of various types of medical billing software solutions and what sort of training and experience workers in the medical billing industry should have. instagram smm panel
ReplyDeleteThere are so many exercise bikes available that it's easy to be overwhelmed. Spinning bikes, stationary bikes, dual action bikes, and recumbent bikes are probably some of the terms you've heard. It's almost as though you have to be a fitness equipment engineer to understand the differences! Here's a quick summary of these confusing terms. DT240 road wheels R&D
ReplyDeleteWow! Thank you! I permanently wanted to write on my site something like that. Can I implement a fragment of your post to my website?
ReplyDelete먹튀검증
The dictionary defines maintenance as, "The work of keeping something in proper order." However, this definition does not necessarily fit for software. Software maintenance is different from hardware maintenance because software doesn't physically wear out, but often gets less useful with age. office 2019 professional plus download
ReplyDeleteIBM Lotus Domino or Microsoft Exchange? The severe competition continues for many years between two main leaders in collaboration solutions - IBM and Microsoft. Whether the choice of a platform influ... windows 10 pro product key
ReplyDeleteOne of the more in-demand degrees today is in the field of technology and IT, and the variety of college and university programs on the internet have made it easier to earn a technology degree online. In fact, some the institutions are strictly technology oriented schools. You can be certified, or you can go for a bachelor's, masters, or even a doctorate degree in technology online at a variety of online colleges and universities. Beijing Soonercleaning Technology
ReplyDeleteHave you noted that when you go and read the news online, and read through the various stories from the syndicated websites that they usually have a technology section, and that technology section is filled with the latest gadgets, social networking methods, and any of the newest things coming from Silicon Valley? I have, and as a lover of technology, and coordinator for a think tank, I am disturbed by all this. Now then let me explain what I mean. Beijing Soonercleaning Technology
ReplyDeleteThere are many types of business hosting available. Which is best is likely to come down to a number of issues related to the nature of the business, the purpose of the website, and the likely amount of traffic. https://onohosting.com/
ReplyDeleteShopping can be a fun activity for some, but for others it is irritating. For those who find it irritating, online shopping is the best option available. Online shopping can be fun, economical, time-saving and simple. Also, since it provides a controlled environment, the chances of splurging are lower. ScraperAPI.com Coupons
ReplyDeleteWith today's technologies and the increasing demand for a wider variety of services, are Web hosting providers pricing their programs competitively to remain in today's market? Web hosting has advanced into a collection of multifaceted specialized categories from shared hosting to dedicate hosting. Also, hosting has always been driven by a growing customer's demand and advances in the latest technology. Cheap Web Hosting
ReplyDeleteAn agreement between an indemnity company and an insured regarding covering the automobile of the insured is called auto insurance. The role of the owner of the auto mobile is to pay premiums periodically. Dell Computer
ReplyDeleteIf it behaves like a drug, and possesses the same characteristics of a drug, then it may very well be a... As many of you know, I have discussed the adverse effects of technology on numerous occasions. Specifically, I am talking about such things as mobile phones, video games, tablets and personal computers, those devices we embrace in the daily affairs of our lives. energy resources
ReplyDeleteChemicals are essential for keeping the backbone of the industrial and agricultural development process in any economy. Chemicals are essential for running industrial operations in multiple ways and therefore the importance of industrial chemical tenders have been growing consistently. Chemicals have multiple uses from agriculture and household articles to weapons and defense oriented products. They are also essential for laboratories and scientific research. Widely used in medicine, agriculture, and cosmetics industries, chemicals are also used by military and scientists for research. However chemical products tenders in such cases may come up with certain restrictions and may not be open to all Order Caluanie
ReplyDeleteHave you ever wondered what attracted you in a new iPad, new smartphone, or any other modern gadget? Was it its fascinating technology or its simplicity of design? Design has become an essential communication tool and it's hard to imaging new technology without it. Design Thinking
ReplyDeleteThe original triathletes were amazing. Dave Scott and Mark Allen accomplished amazing feats in triathlon long before technology took over the sport. AM.CO.ZA
ReplyDeleteLearn the truth about paid gamers and how you too can start testing games for cash. You don't have to dream about being paid to play video games, with this information, you can make it a reality! best discord servers
ReplyDeleteReally I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources. Thanks for share. i enjoy this post. litigation
ReplyDeleteIn 1997 Mr. Clayton M.Christensen ( A Harvard Business School Professor ) introduces a new term "Disruptive Technology". He also describes that displaces an established technology. https://mysmartfaq.com
ReplyDeleteSchools across the globe are going through a growth spurt of sorts, which is both painful and unavoidable. I'm talking, of course, about technology integration. Maybe your class is using a COW (Computer on Wheels) cart once a week or maybe every student in your school is suddenly holding an iPad and administrators are throwing around the dreaded phrase "going paperless." The site is experiencing technical difficulties
ReplyDeleteParents battle with their kids with their use of tablets, mobile phones, TV, and streaming services. How can a parent balance a child's use of technology with education? Houston Pressure Washer
ReplyDeleteTechnology is vital to the existence and competitive edge of any company. I believe that's the great understatement of the year. Look at what technology allows us to do as compared to 30 years ago; now think back about five years, we've come a long way. Forensic Investigations
ReplyDeleteHave you ever wondered how companies come up with their battery life claims? The number is printed confidently on the product packaging, but where did it really come from? Learn how battery life is calculated and become a more informed, savvy consumer of battery-powered devices. 12V 100Ah LiFePO4
ReplyDeleteTechnology is vital to the existence and competitive edge of any company. I believe that's the great understatement of the year. Look at what technology allows us to do as compared to 30 years ago; now think back about five years, we've come a long way. hydrafacial machine
ReplyDeleteCustomer service is crucial to the success of any business, and Cheapest SMM panel are no exception. To ensure a positive experience for your customers, you must respond to their questions and concerns quickly and effectively.
ReplyDeleteIt's a game-changer for small businesses and individuals looking to maximize their online reach without breaking the bank because this cheap SMM panel not only fits my budget but also provides quality services.
ReplyDelete