Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
1) Factorial (for this question just provide an answer for each part)
1.1 Debug the following program to calculate N!
#include
using namespace std;
main()
{
int N, factorial=1;
cout << "Enter a positive integer"
cin >> N;
for(int i=N; i>=1; factorial *= --i);
cout << N<<"!="< return 0; } What was wrong? 1.2 Set N='A'. What is the result? Does it make sense? Modify the program to make sure that the entered value is numeric. Also, modify the program such that it does not accept negative numbers and insists on getting a positive value for N. You can do so by using a while loop that keeps asking for a positive integer till a positive integer is entered. 1.3 Get your code to compute 1!,2!,5!, and 25!. Are you getting the correct answer for all of the entered values? If not, what went wrong? Would you be able to fix this by changing the variable type? Explain your answer.
return 0;
}
What was wrong?
1.2 Set N='A'. What is the result? Does it make sense? Modify the program to make sure that the entered value is numeric.
Also, modify the program such that it does not accept negative numbers and insists on getting a positive value for N. You can do so by using a while loop that keeps asking for a positive integer till a positive integer is entered.
1.3 Get your code to compute 1!,2!,5!, and 25!. Are you getting the correct answer for all of the entered values? If not, what went wrong? Would you be able to fix this by changing the variable type? Explain your answer.
Write a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.
.Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.
Why are all header files not declared in every C program? - Declaring all header files in each program would result in increase in overall file size and load of the program. It
Project Description: We are seeking online invoice OCR solution. That will help us to automate accounts payable function. User should be able to use the offered pdf file or s
write a program to calculate gross salary and net salary using hra da pf in c++
Project Description: Prepare software that will work with our USB hardware that easily lets you backup all the pictures in your computer into the USB stick in one single step. Once
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw
explain me for loop
What is MIME? MIME - Multi-purpose Internet Mail Extensions. MIME types signifies a standard way of classifying file types over Internet. Browsers and Web servers have
In this we will take a closer look at the logic behind Object Oriented Programming. Read through the pseudocode listed below and answer the following questions. Class Square
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!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd