Write a program to print all even numbers between 0 and an integer number entered by
the user using:
a. For loop
b. While loop
c. Do while loop
Write a program which counts for the number of digits in an integer number being
entered by user using:
a. For loop
b. While loop
c. Do while loop
Write a program in c which counts for the number of digits in an integer number being entered by user using: do While loop
A worker takes a job for 5 days. His pay for the day 1 is Rs. X, for day 2 is Rs. 2X and so on. Develop a C program to find the total salary.
Description
You are given an array containing 'n' elements. The array can contain both positive and negative integers. Determine the sum of the contiguous subarray with the maximum sum.
Consider the array {8, -9, 3, 6, 8, -5, 7, -6, 1, -3}.
The maximum subarray will be 3, 6, 8, -5, 7.
The maximum subarray sum will be 3+6+8+(-5)+7 = 19
Input Format:
The input contains the number of elements in the array, followed by the elements in the array.
Output Format:
The output contains the maximum subarray sum.
Sample Test Cases:
Input:
10 8 -9 3 6 8 -5 7 -6 1 -3
Output:
19
Input:
5 8 9 4 5 7
Output:
33
convert to prefix:
( AX * ( BX * ( ( ( CY + AY ) + BY ) * CX ) ) )
This is my code C++ for my assignment. Please help me to convert it to C code. Thank you!
#include <iostream>
using namespace std;
float f1(float a){
float s;
if (a<250)
s=a*0.11;
else
s=250*0.11+(a-250)*0.17;
return s;
& }
float f2(float a){
& return f1(a)*1.1;
& }
int main(void)
{
float a;
cout<<"enter the number of kilowatt hours consumed : ";
cin>>a;
cout<<"total amount: "<<f2(a)<<endl;
system ("PAUSE");
}
See more: C
Parking lot charges rs.30.00as a minimum fee to park a vehicle for upto 3hours.an additional charge of re 5.00 per hour will be added if exceed three hours.for 24hours the parking fee are 80.00 write a program to define an array and read the vehicle registration bumber,and hiurs parked for each customer and calculate the parking for n customer and display the output
Accept 10 numbers from the user and calculate their sum.
. A right triangle can have sides whose lengths are all integers. The set of three integer
values for the lengths of the sides of a right triangle is called a Pythagorean triple.
The lengths of the three sides must satisfy the relationship that the sum of the squares
of two of the sides is equal to the square of the hypotenuse. Write an application that
displays a table of the Pythagorean triples for side1, side2 and the hypotenuse, all no
larger than 500. Use a triple-nested for loop that tries all possibilities. This method is
an example of “brute-force” computing. You’ll learn in more advanced computer
science courses that for many interesting problems there’s no known algorithmic
approach other than using sheer brute force.