Description
Parameters: What does the following program print?
#include <stdio.h>
void f1(int *a, int *b){
*a += *b;
}
void f2(int *a, int *b){
*a -= *b;
}
void f3(int *a, int *b){
int i;
for (i = 0; i < 3; i++) {
f1(a, b);
printf( “a= %i” , *a);
}}
void main () {
int x =6;
int y =2;
int z =7;
f2 (&x, &y);
f3 (&x, &z);
printf( “ \nx=%i, y=%i, z=%i” , x, y, z);
}
ANSWER IS:
a =11 a=18 a=25
x=25 y=2 z=7
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Review
Review
Anonymous
I was struggling with this subject, and this helped me a ton!
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Terrier news, computer science homework help
Read the following case and respond to the question below the case. Type your solution on a Microsoft Word document and a ...
Terrier news, computer science homework help
Read the following case and respond to the question below the case. Type your solution on a Microsoft Word document and attach.Terrier NewsTerrier News is a monthly newsletter devoted to various breeds of terriers and topics of interest to terrier owners and breeders. Annie West, the editor and publisher asked you to help her design a system to enter and manage the hundreds of classified ads that Terrier News Publishes. Some ads are for dogs wanted; some are for dogs for sale; and some offer products for services.TaskDesign a suitable source document for ads that are telephoned or mailed in.Your paper should be between 500 and 750 words and reflect scholarly writing and current APA standards. Please include citations to support your ideas.
6 pages
Cyber Security Assignment
The concept of defense in depth can be broken down into three different security control types. Identify the security cont ...
Cyber Security Assignment
The concept of defense in depth can be broken down into three different security control types. Identify the security control type of each set
4 pages
Blockchain Technology
1. Compare the features and usage of public and private blockchains. A public blockchain refers to a permissionless form o ...
Blockchain Technology
1. Compare the features and usage of public and private blockchains. A public blockchain refers to a permissionless form of blockchain. With this type ...
5 pages
Critical Review
Investigation on cyber-attacks in organizations looks to understand the occurrence of cyber-attacks and identify methods o ...
Critical Review
Investigation on cyber-attacks in organizations looks to understand the occurrence of cyber-attacks and identify methods of dealing with the ...
Discussion MOD 5 Cloud Storage
You recently left your flash drive in the college computer la and lost all of your assignments. You now have to redo all y ...
Discussion MOD 5 Cloud Storage
You recently left your flash drive in the college computer la and lost all of your assignments. You now have to redo all your work. You have heard of cloud storage services such as OneDrive, Google Drive, and Dropbox from your friends.AssignmentYou decide to research the different types of cloud storage to back up your assignments. Using the internet, research three different cloud storage services and document your results in MS Office Word that includes the following information:Web address of the serviceImage of the cloud service websiteStorage fee, either by month or year (or indicate if free)Storage capacitySpeed of uploads and downloadsAvailable support servicesCreate an account with one online storage service (If you don't have one). Load your research to the online storage site. Create a shared link to share your work.PostCreate a thread on this discussion board with the following:500 wordsShare (copy from online storage and paste into the discussion board) a hyperlink to your your shared link from your research in a word file for the findings on the three online storage services.Reveal which online storage you used. What was your experience using online storage. Was it easy or difficult? Would you use online storage again?Has online storage ever benefited you in school/work?
Computer Science Project on Control Structures
PurposeThe project can help you develop programs that require repetitive actions, and choose the adequate repetition struc ...
Computer Science Project on Control Structures
PurposeThe project can help you develop programs that require repetitive actions, and choose the adequate repetition structures based on the type of application. You will s olve programming problems using various types of loops, by creating the algorithms and implementing them in Java.DirectionsConsider the following problems, design the algorithms that would solve them, and then implement the algorithm in Java.
Problem 1:Write a program that reads a set of floating-point values. Ask the user to enter the values, then print:
The average of the valuesThe smallest of the valuesThe largest of the valuesThe range, that is the difference between the smallest and the largestOf course, you may only prompt for the values once.Problem 2:Write a program that reads a word and prints each character of the word on a separate line. For example, if the user provides the input "Harry", the program prints:HarryProblem 3:The Fibonacci numbers are defined by the sequence:
f1 = 1f2 = 1fn = fn-1 + fn-2.Reformulate that as
Fold1 = 1;Fold2=1;Fnew=fold1+fold2;After that, discard fold2, which is no longer needed, and set fold2 to fold1, and fold1 to fnew. Repeat an appropriate number of times.Implement a program that prompts the user for an integer n and prints the nth Fibonacci number, using the above algorithm.Problem 4:Write a program that prints a multiplication table, like this:1 2 3 4 5 6 7 8 9 102 4 6 8 10 12 14 16 18 203 6 9 12 15 18 21 24 27 30…10 20 30 40 50 60 70 80 90 100Problem 5:This problem is the Problem 4 in Unit 2 for the algorithm project. Now you already have the algorithm and you can copy it here. You still need to write the source code and take a screenshot of the running program. Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are in a grid of streets, somewhat lost, and you randomly pick one of four directions and walk to the next intersection. Not knowing where you really want to go, you again randomly pick one of the four directions, and so on. After repeating the same movement for a number of times, you may want to know how far you got from the original point.Represent locations as integer pairs(x,y). Create an algorithm that implements your movement through New York City, over 100 intersections, starting at (0,0) and print the ending location, taking into consideration that each movement, from one intersection to another will be one mile.Submission: You are required to submit the following files for this assignment by clicking the link, Project 5 - Repetition Structures, above.
One Java file for each problem, which means you need to submit five Java files.A Word document containing the algorithms and the screenshots of the running programs for all of the five problems. Please name your Word document as P5_Last Name_First Name.docx or .doc. For example, P5_Smith_John.docx.GradingThis assignment is worth 50 points toward your course grade. There are five problems. Each problem is worth 10 points and will be graded as the following:Algorithm - 2 points.Java Program - 6 points.Screenshot of the running program - 2 points.
Similar Content
What are the adverb phrases in the following
The weathered sculpture, Fountain of Time, stands in Chicagos Washington Pak. This work shows humanity as it struggles thr...
Need help with computer science and completing planning documents in response to a Request for Proposals (RFP
Hello Need and Project Framework file which is attached to this question , The RFP for the It Support ...
Need two 500 words paper with same criteria for two courses
Description: Develop a paper describing how the knowledge, skills, or theories of this course have been applied or could b...
CIS 110 San Diego City College Principles Information System Excel Worksheet
Please Use the exact excel file that i share with you!! please and thank you ...
ISM 581 CSUGC Cloud Based Security Concerns Essay
Cloud-based technology offers organizations a means to deploy new applications and software without the costly overhead of...
I want a reply post to the below essay in 250 words using apa format and include at least a reference from journal articles
Question: Search for a company, school, or person that has been the RECENT target of a network or system intrusion? What i...
Related Tags
Book Guides
Untamed
by Glennon Doyle
Cant Hurt Me - Master Your Mind and Defy the Odds
by David Goggins
The Picture of Dorian Gray
by Oscar Wilde
Wuthering Heights
by Emily Brontë
The Goldfinch
by Donna Tartt
Death Of A Salesmen
by Arthur Miller
A Portrait of the Artist as a Young Man
by James Joyce
The Visible Filth
by Nathan Ballingrud
All Quiet on the Western Front
by Erich Maria Remarque
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Terrier news, computer science homework help
Read the following case and respond to the question below the case. Type your solution on a Microsoft Word document and a ...
Terrier news, computer science homework help
Read the following case and respond to the question below the case. Type your solution on a Microsoft Word document and attach.Terrier NewsTerrier News is a monthly newsletter devoted to various breeds of terriers and topics of interest to terrier owners and breeders. Annie West, the editor and publisher asked you to help her design a system to enter and manage the hundreds of classified ads that Terrier News Publishes. Some ads are for dogs wanted; some are for dogs for sale; and some offer products for services.TaskDesign a suitable source document for ads that are telephoned or mailed in.Your paper should be between 500 and 750 words and reflect scholarly writing and current APA standards. Please include citations to support your ideas.
6 pages
Cyber Security Assignment
The concept of defense in depth can be broken down into three different security control types. Identify the security cont ...
Cyber Security Assignment
The concept of defense in depth can be broken down into three different security control types. Identify the security control type of each set
4 pages
Blockchain Technology
1. Compare the features and usage of public and private blockchains. A public blockchain refers to a permissionless form o ...
Blockchain Technology
1. Compare the features and usage of public and private blockchains. A public blockchain refers to a permissionless form of blockchain. With this type ...
5 pages
Critical Review
Investigation on cyber-attacks in organizations looks to understand the occurrence of cyber-attacks and identify methods o ...
Critical Review
Investigation on cyber-attacks in organizations looks to understand the occurrence of cyber-attacks and identify methods of dealing with the ...
Discussion MOD 5 Cloud Storage
You recently left your flash drive in the college computer la and lost all of your assignments. You now have to redo all y ...
Discussion MOD 5 Cloud Storage
You recently left your flash drive in the college computer la and lost all of your assignments. You now have to redo all your work. You have heard of cloud storage services such as OneDrive, Google Drive, and Dropbox from your friends.AssignmentYou decide to research the different types of cloud storage to back up your assignments. Using the internet, research three different cloud storage services and document your results in MS Office Word that includes the following information:Web address of the serviceImage of the cloud service websiteStorage fee, either by month or year (or indicate if free)Storage capacitySpeed of uploads and downloadsAvailable support servicesCreate an account with one online storage service (If you don't have one). Load your research to the online storage site. Create a shared link to share your work.PostCreate a thread on this discussion board with the following:500 wordsShare (copy from online storage and paste into the discussion board) a hyperlink to your your shared link from your research in a word file for the findings on the three online storage services.Reveal which online storage you used. What was your experience using online storage. Was it easy or difficult? Would you use online storage again?Has online storage ever benefited you in school/work?
Computer Science Project on Control Structures
PurposeThe project can help you develop programs that require repetitive actions, and choose the adequate repetition struc ...
Computer Science Project on Control Structures
PurposeThe project can help you develop programs that require repetitive actions, and choose the adequate repetition structures based on the type of application. You will s olve programming problems using various types of loops, by creating the algorithms and implementing them in Java.DirectionsConsider the following problems, design the algorithms that would solve them, and then implement the algorithm in Java.
Problem 1:Write a program that reads a set of floating-point values. Ask the user to enter the values, then print:
The average of the valuesThe smallest of the valuesThe largest of the valuesThe range, that is the difference between the smallest and the largestOf course, you may only prompt for the values once.Problem 2:Write a program that reads a word and prints each character of the word on a separate line. For example, if the user provides the input "Harry", the program prints:HarryProblem 3:The Fibonacci numbers are defined by the sequence:
f1 = 1f2 = 1fn = fn-1 + fn-2.Reformulate that as
Fold1 = 1;Fold2=1;Fnew=fold1+fold2;After that, discard fold2, which is no longer needed, and set fold2 to fold1, and fold1 to fnew. Repeat an appropriate number of times.Implement a program that prompts the user for an integer n and prints the nth Fibonacci number, using the above algorithm.Problem 4:Write a program that prints a multiplication table, like this:1 2 3 4 5 6 7 8 9 102 4 6 8 10 12 14 16 18 203 6 9 12 15 18 21 24 27 30…10 20 30 40 50 60 70 80 90 100Problem 5:This problem is the Problem 4 in Unit 2 for the algorithm project. Now you already have the algorithm and you can copy it here. You still need to write the source code and take a screenshot of the running program. Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are in a grid of streets, somewhat lost, and you randomly pick one of four directions and walk to the next intersection. Not knowing where you really want to go, you again randomly pick one of the four directions, and so on. After repeating the same movement for a number of times, you may want to know how far you got from the original point.Represent locations as integer pairs(x,y). Create an algorithm that implements your movement through New York City, over 100 intersections, starting at (0,0) and print the ending location, taking into consideration that each movement, from one intersection to another will be one mile.Submission: You are required to submit the following files for this assignment by clicking the link, Project 5 - Repetition Structures, above.
One Java file for each problem, which means you need to submit five Java files.A Word document containing the algorithms and the screenshots of the running programs for all of the five problems. Please name your Word document as P5_Last Name_First Name.docx or .doc. For example, P5_Smith_John.docx.GradingThis assignment is worth 50 points toward your course grade. There are five problems. Each problem is worth 10 points and will be graded as the following:Algorithm - 2 points.Java Program - 6 points.Screenshot of the running program - 2 points.
Earn money selling
your Study Documents