hi! i'm a beginner in using turbo c can anyone help we with these problems?

help will be very very very very very much appreciated

C PROGRAM # 13: INCLUSIVE VALUES
Write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two values.
Enter Start:
5
Enter End:
9

5
6
7
8
9

C PROGRAM # 14: ADDING UP INTEGERS

Write a program that adds up integers that the user enters. First the program asks how many numbers will be added up. Then the program prompts the user for each number. Finally it prints the sum.
How many integers will be added?:
5

Enter an integer 1:
3
Enter an integer 2:
4
Enter an integer 3:
-4
Enter an integer 4:
-3
Enter an integer 5:
7

The sum is 7
C PROGRAM # 15: SUM OF 1/N
Write a program that computes the following sum:
sum = 1.0/1 + 1.0/2 + 1.0/3 + 1.0/4 + 1.0/5 + .... + 1.0/N
N will be an integer limit that the user enters.

Enter N
4

Sum is: 2.08333333333
C PROGRAM #16: ADDING UP SQUARES AND CUBES
Write a program that adds up the squares and adds up the cubes of integers from 1 to N, where N is entered by the user:
Upper Limit:
5

The sum of Squares is 55
The sum of Cubes is 225

C PROGRAM #17: POWER OF A NUMBER
Write a program that computes XN where X is a floating point number and N is a positive integer. The program informs the user that N must be positive if the user enters a negative value. Of course,
XN = X * X * X * ... * X
--------------------
N times
The user dialog will look something like this:
Enter X
1.3
Enter N
5

1.3 raised to the power 5 is: 3.71293

-------

Enter X
5.6
Enter N
-3

N must be a positive integer.
PROGRAM # 18: WEDGE OF STARS
Write a program that writes a wedge of stars. The user enters the initial number of stars, and the program writes out lines of stars. Each line has one few star than the previous line:
Initial number of stars:
7

*******
******
*****
****
***
**
*
PROGRAM #19: MILES PER GALLON
Write a program that calculates miles per gallon for a list of cars. The data for each car consists of initial odometer reading, final odometer reading, and number of gallons of gas. The user signals that there are no more cars by entering a negative initial odometer reading.
Miles per Gallon Program
Initial miles:
15000
Final miles:
15250
Gallons
10
Miles per Gallon: 25.0

Initial miles:
107000
Final miles:
107450
Gallons
15
Miles per Gallon: 30.0

Initial miles:
-1
Write a program that asks the user for the low and high integer in a range of integers. The program then asks the user for integers to be added up. The program computes two sums:
• The sum of integers that are in the range (inclusive),
• and the sum of integers that are outside of the range.
The user signals the end of input with a 0.
Low end of range:
20
High end of range:
50
Enter data:
21
Enter data:
60
Enter data:
49
Enter data:
30
Enter data:
91
Enter data:
0

Sum of in range values: 100
Sum of out of range values: 151

Even with just one problem or two..

3
Contributors
5
Replies
11
Views
7 Years
Discussion Span
Last Post by keichi19

Homework??? Let's see the code you have started to solve all those problems. We are not here to do your homework for you.

sir,

can this be done using turbo c?

>>can this be done using turbo c?
Probably not.

All you did was post a bunch of java code in the c forum.

Edited by Ancient Dragon: n/a

Please stop posting other people's code!

You were given these assignments so you could learn BY DOING them, how to program in C. Practice the exercise of your own logic, and learn C syntax and get an introduction to troubleshooting. All of these skills are essential for a C programmer.

Copying other people's code (especially in other languages), won't help you to learn C. You need to accept that truth, and get engaged. It's your education. Use your time in school, wisely.

Help needed here!!!

Write a program that asks the user for the low and high integer in a range of integers. The program then asks the user for integers to be added up. The program computes two sums:
• The sum of integers that are in the range (inclusive),
• and the sum of integers that are outside of the range.
The user signals the end of input with a 0.
Low end of range:
20
High end of range:
50
Enter data:
21
Enter data:
60
Enter data:
49
Enter data:
30
Enter data:
91
Enter data:
0

Sum of in range values: 100
Sum of out of range values: 151

``````#include <stdio.h>
#include conio.h>
#define p printf
#define s scanf

main ()

{

int sum1 = 0,sum2 = 0, data, l_in_r, h_in_r, prob, ctr_loop, loop1 =

3, loop2 = 3, loop3 = 4, num_loop=7, num2_loop = 8;
clrscr();

p("Low end of range: ");
s("%d", &l_in_r);
p("High end of range: ");
s("%d", &h_in_r);

p("Enter data :    ");
s("%d", &data);
( num2_loop++);

while ((data > 0) || (data < 0))
{
if (data >= l_in_r && data <= h_in_r)
{
sum1 += data;
}
else
{
sum2 += data;
}
go(8, num_loop++);p("Enter data :    ");
s("%d", &data);
if ((data > 0) || (data < 0))
{go(8, num2_loop++);}
else
go(8, num2_loop++);p(" ");
}
go(8, num2_loop++);p("Sum of in range values: %d", sum1);
go(8, num2_loop++);p("Sum of out of range values: %d\n",

sum2);

getch();

}``````

Edited by __avd: Added [code] tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.