Dear collgues,am new to C and have been assignment to submit:
Can someone help with these problems:
Part I

1.      An automobile travels at an average speed of 55 miles an hour for 4
hours. Write a program that displays the distance, in miles, the car
has travelled after 0.5,1,1.5 hrs e.t.c  until the end of the trip.
2.      Write a program to convert Celsius degrees to Fahrenheit. The
program should request the starting Celsius value, the number of
conversions to be made and the increment between Celsius values. The
display should have appropriate headings and list the Celsius value
and the corresponding Fahrenheit  values (hint,use the relationship :
Fahrenheit =(9.0/5.0)*Celsius+32.0)
3.      Modify the above program to request the starting Celsius value, the
ending Celsius value and the increment. Thus instead of the
conditional checking for fixed count, the condition l check for ending
Celsius value.
4.      Write a program that will calculate the sum of every third integer,
beginning with I=2(i.e calculate the sum 2+5+8+11+…) for all; values
of I that are less than 100 susing
•       Using a while loop
•       Using a do-while statement
•       Using a for loop
5.      Modify the program above to calculate the sum of every nth integer
beginning with nstart (i.e. i=nstart,nstart+n,nstart+2*n,nstart+3*n
and so on).continue the looping process for all values of I that do
not exceed nstop.




Part II
1.      Write a function called pow() that computes the nth power of a
float and returns a float i.e. pow(x,n) returns the value of x raised
to n. use this function program to which you input PRINCIPAL,RATE and
DURATION to get the AMOUNT.
Hint: AMOUNT = PRINCIPAL {1+(RATE/100)}n
Where n=DURATION in years
2.      Write a function float avg(float values[],int num)
which will return the average of num values contained in the array.
3.      Write a function square(x) to compute square of any number.
        


Reply via email to