Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 9E
Explanation of Solution
The program will find out the next largest even multiple for the given values:
//include the header file
#include <stdio.h>
//definition of main method
int main (void)
{
//declare and initialize value to the variables
int i = 365, j = 7, ans;
//calculate the ans
ans = i + j - i % j;
//display the result
printf ("The answer of i = %d and j = %d is: %d\n", i, j, ans);
//reinitialize value to the variables
i = 12258;
j = 23;
//calculate the ans
ans = i + j - i % j;
//display the result
printf...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
let n = 1*3*5*....*197*199 (the product of first 100 odd numbers)
find the last 2 digits of n
Suppose n is a positive integer.
ii.
find the value of N so that y less than 0.00000075.
Knowledge Booster
Similar questions
- 2. How many even 4-digit numbers greater than 3000 can be formed from the digits 2, 6, 7, 8, 9 if no digit can be used more than once?arrow_forwardWrite an algorithm that asks the user to enter a positive integer n and prints the sum of the divisors of n.arrow_forwardwt A = {2, 0, 2, 4, 5}. What does the summation below evaluate to? 37 39 41 43 45 Ο 49 Σαλ DEAarrow_forward
- ISBN-13 is a new standard for identifying books. It uses13 digits d1d2d3d4d5d6d7d8d9d10d11d12d13. The last digit d13 is a checksum, which iscalculated from the other digits using the following formula: 10 - (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12)%10If the checksum is 10, replace it with 0. Your program should read the input as astring. Here are sample runs: Enter the first 12 digits of an ISBN-13 as a string: 978013213080 ↵EnterThe ISBN-13 number is 9780132130806arrow_forwardOn the planet Tatooine, droids do computations in base-6. What is the greatest base-6 number with three different digits? (Your base-6 number must have a separate digit for each digit.) Make a decimal out of your answer (base-10).arrow_forwardWrite a program that computes the following: sigma summation i=0 to N (i^3 +2N)arrow_forward
- Binary numbers need more places for counting because A. They are always big numbers B. Any no. of 0's can be added in front of them C. Binary base is small D. 0's and l's have to be properly spaced apart E. None of the abovearrow_forwardMIPS: Write a program that compare two single precision floating point numbers numA and numB. If numA is greater than numB, Swap the numbers.arrow_forwardPlease calculate the multiplication series of 8 matrices: A*B*C*D*E*F*G*H The dimensions are: 32x35, 35x24, 24x30, 30x36, 36x25, 25x40, 40x34, 34x35 What is the best order to multiply them? Please use parentheses to express the multiplication order, such as (((AB)(CD))((EF)(GH))) How many multiplications are required in total?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning