Question

Programming in C: Write a program that accepts an integer and two floating-point values and prints...

Programming in C:

Write a program that accepts an integer and two floating-point values and prints the sum of these values. Example: Input:12,13.14,6.7; Output:31.84. Use formatted I/O

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <stdio.h>

int main()
{
   int i;
   float f1, f2;
   printf("Enter an integer and two floating-point values:\n");
   scanf("%d",&i);
   scanf("%f",&f1);
   scanf("%f",&f2);
   printf("%f",i+f1+f2);
   return 0;
}

Output:

Enter an integer and two floating-point values: 12 13.14 6.7 31.840000

Add a comment
Answer #2
Write a c program that allows you to enter any two float values of amount and rate.the program then multiply the amount and rate and display on the screen?
Add a comment
Know the answer?
Add Answer to:
Programming in C: Write a program that accepts an integer and two floating-point values and prints...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C programming! Write a program that reads integers until 0 and prints the sum of values...

    C programming! Write a program that reads integers until 0 and prints the sum of values on odd positions minus the sum of values on even positions. Let ?1, ?2, … , ??, 0 be the input sequence. Then the program prints the value of ?1 − ?2 + ?3 − ?4 + ⋯ ??. The input is a sequence of integers that always contains at least 0 and the output will be a single number. For example, for input...

  • Write a programming java that prints the sum of cubes. Prompt for and read two integer...

    Write a programming java that prints the sum of cubes. Prompt for and read two integer values from the user and print the sum of each value raised to the third power, i.e., (?3+?3). Sample output: (user input) Enter x as an int: 3 Enter y as an int: 4 (3^3) + (4^3) = 91

  • C Programming: Write a program that inputs two strings that represent floating-point values, convert the strings...

    C Programming: Write a program that inputs two strings that represent floating-point values, convert the strings to double values. Calculate the sum,difference,and product of these values and print them. int main(){    // character string value array for user    char stringValue[10];       double sum=0.0;// initialize sum to store the results from 2 double values       double difference=0.0; // initialize difference to store the results from 2 double values       double product = 0.0; // intitialzie product...

  • USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number s...

    USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number separated by commas. Sample output: Bob Marley, 20, 5.2 2. 2. Write a program that asks the user for a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’). Generate a random number of any size, integer or floating point, and combine those three pieces of information...

  • RAPTOR PROGRAMMING Write a program which will receive two integer values as input. Then prompt the...

    RAPTOR PROGRAMMING Write a program which will receive two integer values as input. Then prompt the user to choose one of the following operations and produce an output with the selected operation. 1. Addition 2. Subtraction 3. Multiplication 4. Division 5. Modulo Division Example output with response: Please enter an input: 2 Please enter another input: 3 Please choose from the follow: 1. Addition 2. Subtraction 3. Multiplication 4. Division 5. Modulo Division Output: 2 % 3 is 2.

  • Write a program that reads a positive integer N, where N is greater than 1 and...

    Write a program that reads a positive integer N, where N is greater than 1 and prints the value of the floating-point value SUM where SUM is the results of the following series. SUM = 1/1! + 2/2! + 3/3! + 4/4! + ... N/N! Note that your program should print the message “Sorry, bad N”” if N is <=1, and keep reading user input until the user enters a valid value for N. Also, note that all division operations...

  • Write a program that takes an operation (+, -, /, or *) and two floating-point numbers,...

    Write a program that takes an operation (+, -, /, or *) and two floating-point numbers, and outputs the result of applying that operation to the two numbers. For example, if the input is: + 100 3.14 the output should be 100 + 3.14 = 103.14 Likewise, if the input is * 4 5 the output should be 4 * 5 = 20 You may assume the input is well-formed; that is, the first string is one of the four...

  • and then print their average. Write a C program that accepts a string of text from...

    and then print their average. Write a C program that accepts a string of text from the user and prints back the string without any of the vowels. For example, if the user entered "Hello, world", the program should print "Hll, wrld" Write a C program that accepts an integer in decimal from the user and prints the number of 1' bits in the integers binary representation. For example, if the user entered 14, the program should print 3 because...

  • Write a program that reads two integer values. It then calculates and displays the sum and...

    Write a program that reads two integer values. It then calculates and displays the sum and average of all values between them, Le. if the first value is vi and the second value is 2, then the program calculates and displays the sum and average of all values in the closed range Iv1,2 Your Program must satisfy the following constraints: A. make sure that v1 is less than 2 B. Use a function named getStats(that takes two integer yalues as...

  • Instructions Write a C++ program that performs the following: Accept a list of floating point values...

    Instructions Write a C++ program that performs the following: Accept a list of floating point values on a single line (separated by spaces). This is vector A. The user may enter as many values as they desire. Accept a second list of floating point values on a single line (separated by spaces). This is vector B. The user may enter as many values as they desire. There is no requirement that the two vectors have the same number of elements....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT