Write a function that returns the largest of five floating

Assignment Help C/C++ Programming
Reference no: EM131938921

Question 1

Numbers perfectly divisible by 2 are known even numbers and numbers which are not divisible by 2 are called odd numbers.

(a) Draw a flowchart that takes 10 integers from a user and checks whether that the numbers are even or odd and displays the result.

(b) Write a program that performs the above task.

Question 2

Write a function that returns the largest of five floating-point numbers. Assume the function receives five floating-point numbers from the caller function.

Question 3

(a) Discuss the differences between counter control repetition and sentinel control repetition.

(b) Describe the technique to generate a different sequence of random numbers each time the program runs.

Question 4

Find the error in each of the following (Note: there may be more than one error):

(a) for ( x = .000001; x = .0001;x+= .000001 ) wind( "%.7fin", x );

(b) The following code should output the odd integers from 999 to I:

for(x=999;x>=1;x-2 )
printf( "%chi", x );

(c) The following code should output the even integers from 2 to 100: counter = 2;

Do {
if( counter % 2 = )
printf( "%u1n", counter );
counter -I- 2;
} While ( counter < 100 );

(d) The following code should sum the integers from 100 to 150 (assume total is initialized to 0):

for ( x = 100; x <= 150; -I-1-x );
total += x;

Question 5

(a) What will be output of following c code? Explain your answer.

#include<stdio.h> int main()

{
int x=9,i;
for(i=0;i<x;i-1-3){ printf("Start "); continue;
printf(" End");
}
return 0;
}

(b) What will be output of following c code? Explain your answer.

#include<stdio.h> int main()

(

int i=1;

for(i=0;i=-1;i=1) { printf("%d ",i);

if(i!=l) break;
}
return 0;

Reference no: EM131938921

Questions Cloud

Break-even ratio excluding capital expenditures : What is the year 1 break-even ratio excluding capital expenditures?
How much should she be saving during her working life : If the investor can earn 6% during her retirement years and 10% during her working years, how much should she be saving during her working life?
Price-to-book ratio : As an entrepreneur you started a tech company a decade ago to design apps for the retail clothing space. You want to know the price-to-book ratio?
Evaluation of succession planning at audit office of guyana : An evaluation of succession planning at the Audit Office of Guyana - Describe the problems in the company - Explain the benefits to the company
Write a function that returns the largest of five floating : Draw a flowchart that takes 10 integers from a user and checks whether that the numbers are even or odd and displays the result.
Supply specialized parts to auto industry : A college friend started a small manufacturing concern about 15 years go to supply specialized parts to the auto industry.
What is accrued interest : If the coupon rate for this corporate bond is 6% and the par value of the issue purchased is $1,000, what is the accrued interest?
The required return equal to the expected return : what is the value of the stock today (assume the market is in equilibrium with the required return equal to the expected return)?
What is your tax liability : How much did you earn, both in total and percentage, and what is your tax liability?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd