
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
I’m really struggling with fixing this error in this c program.This error code keeps popping up in my Linux putty server when I try to compile and run , it fails to compile .I don’t know how to fix it .
![sh exijs gcc sumTimes2.c
In function '
error: 1
15158a0
' loop initial declarations are only allowed in C99
mode
for (int i = num; i <= end; i++) {
note: use option -std-c99 or -std-gnu99 to compile your code
web ex1] $](https://content.bartleby.com/qna-images/question/3c5a5d39-4610-4542-84f3-e3a5fb07be7c/07d4657f-3ef0-4ccb-aaeb-5451d80b1af4/uiiy5hg_thumbnail.jpeg)
Transcribed Image Text:sh exijs gcc sumTimes2.c
In function '
error: 1
15158a0
' loop initial declarations are only allowed in C99
mode
for (int i = num; i <= end; i++) {
note: use option -std-c99 or -std-gnu99 to compile your code
web ex1] $

Transcribed Image Text:#include<stdio.h>
}
}
int sumFor (int num) {
int sum = 0;
int end num * 2;
=
for (int i = num; i <= end; i++) {
sum + i;
}
return sum;
int sumWhile (int num) {
int sum = 0;
int end = num * 2;
int i = num;
while (i <= end) {
sum += i;
i++;
}
return sum;
int main()
printf("Welcome to sumTimes2.\n\n");
printf("This program will sum the integers between the one you enter and the integer that is twice that value.\n");
print ("Please enter your integer: ");
int num;
scanf("%d", &num);
printf("\n");
int sum1 = sumFor (num);
int sum2= sumWhile (num);
printf ("For says the sum is %d while says the sum is %d\n", suml, sum2);
printf("Thank ytou for using sumTimes2. BYE!\n");
return 0;
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- The Nevercrash Operating System Company has been receiving complaints from some of its customers about its latest release, which includes semaphore operations. They feel it is immoral for processes to block (they call it "sleeping on the job"). Since it is company policy to give the customers what they want, it has been proposed to add a third operation, peek, to supplement up and down. peek simply examines the semaphore without changing it or blocking the process. In this way, programs that feel it is immoral to block can first inspect the semaphore to see if it is safe to do a down. Will this idea work if three or more processes use the semaphore? If two processes use the semaphore?arrow_forwardproblem is attached! I am completely stuck! I really need help! please and thank you so much!arrow_forwardImplement Tower of Hanoi algorithm in your preferred programming language. Then run the implementation with 1, 5, 25, and 125 disks. Record the amount of time it takes for each of these input sizes. What do you infer from this experiment?arrow_forward
- I dont get it. Why can't you fix this code? There are 3 errors. That's it. So why can't you do it? Give me a valid reason. Is it really complex or you just don't want to do it? I got this code from you so I know you are lying. You are giving me the same PATHETIC excuse again and again. Just say that you don't want to do it. If you do I will leave it. The code is in the link. Your website only allows 5000 words https://docs.google.com/document/d/1HvSmPG3aG-xMGHkxbTNf4fj_CbYc2axmuBbVDPCOEIE/edit?usp=drivesdkarrow_forwardI need help with an assignment. I am confused as to if the manual is asking to implement and modify the java code provided to us or create one following the code written in the java file provided. So please help me figure that out and provide with a sultion. Rest of the instruction manual is attatched in the images. I am pasting the java code provided to me below. java code provided to me as mentioned in step 1 of manual. package homework; // ComputeMeanDeviation.java: Demonstrate using the math methodspublic class ComputeMeanDeviation { /** Main method */ public static void main(String[] args) { int count = 10; // Total numbers int number = 0; // Store a random number double sum = 0; // Store the sum of the numbers double squareSum = 0; // Store the sum of the squares // Create numbers, find its sum, and its square sum for (int i = 0; i < count; i++) { // Generate a new random number number = (int)(Math.random() * 1000); // Add the number to…arrow_forwardFrom a programmer's point of view, if you want to argue that deep access is better than shallow access, you shouldn't just talk about speed.arrow_forward
- Hello Can you please help me with this code because I am struggling how do to this, can you please help me this code has to be in C. Write a multithreaded program that calculates various statistical values for a list of numbers. This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, and the third will determine the minimum value. For example, suppose your program is passed the integers 90 81 78 95 79 72 85 The program will report The average value is 82 The minimum value is 72 The maximum value is 95 The variables representing the average, minimum, and maximum values will be stored globally. The worker threads will set these values, and the parent thread will output the values once the workers have exited. (We could obviously expand this program by creating additional threads that determine other statistical values, such as…arrow_forwardCould you explain what the difference is between having "many processes" and having "many threads"? Could you perhaps expound on this for me for a line or two if it's not too much trouble? I'd really appreciate it.arrow_forwardWrite a program to handle a user's rolodex entries. (A rolodex is a system with tagged cards each representing a contact. It would contain a name, address, and phone number. In this day and age, it would probably have an email address as well.) Typical operations people want to do to a rolodex entry are: 1) Add entry 2) Edit entry 3) Delete entry 4) Find entry 5) Print all entries 6) Quit You can decide what the maximum number of rolodex entries is and how long each part of an entry is (name, address, etc.). When they choose to edit an entry, give them the option of selecting from the current rolodex entries or returning to the main menu — don't force them to edit someone just because they chose that option. Similarly for deleting an entry. Also don't forget that when deleting an entry, you must move all following entries down to fill in the gap. If they want to add an entry and the rolodex is full, offer them the choice to return to the main menu or select a person to overwrite. When…arrow_forward
- Sockets are low-level networking interfaces between computers. Many programming languages come standard with socket libraries for creating socket connections. In this lab, we’ll study the usage of networking sockets in Python to write a custom client/server program. Client/Server source code as a ZIP or RAR file in D2L Word document outlining the description of your program. The word document should contain screenshots containing your name on the VM and reports of what’s occurring in them. Demonstrate your socket solution accomplishes the following: The client connects to the server Client and server successfully exchange messages Following the TCP stream in Wireshark Identifying the message sent in Wireshark Any additional functionality you created in your solution. please use python.arrow_forwardYou are handed the source code for an application that fails when run. Running it 10 times in a debugger reveals that it never crashes in the same spot. The application runs in a single thread and solely makes use of the C standard library. What programming faults may be the source of this crash? How would you put each one to the test?arrow_forwardComputer screens often use the WIMP layout. The Desktop metaphor is widely used in WIMP implementations, and it maps typical operations to their concrete equivalents. To move a file, just click and drag it to its new home (a different folder or the desktop). Give us two procedures and the situations in which they might be used.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education