Question

(60-140) Lab Exercises #3-2 (Due at the end of the lab period) May. 28-30, 2018. Part B: C Programming Exercise a) Implement the algorithm as represented by factorial, rap, and write an Objective: Programming with loops The factorial for a positive integer n is defined as In addition, it is generally agreed that 0!-1 when n0 Part A: RAPTOR Exercise equivalent C program that not only accomplishes what the flowchart does but also b) Save your program to a file named factorial.c in the working directory on the c) Demonstrate the factorial.cfile to GA/TAs and run with different input values. follows the structure of the flowchart when choosing C loop statements. n-23(n-1) n PC you are using a) Watch the video clip about how to work with loops. b) Start RAPTOR and create a flowchart that asks a user for a number (n) between 0 and 9 and computes and displays the factorial table from 0 to n A sample interaction is shown below Enter a positive integer between 0 and 9: 6 Input number cannot be less than 0 Enter a positive integer between 0 and 9: 12 Input number cannot be greater than 9 Enter a positive integer between 0 and 9:6 316 5!120 6720 c) Use a structure that corresponds to the for statement of C when calculating n! d) For simplicity, it is assumed that the user input is always a whole number, and therefore this is no need to check e) Save the flowchart to a file named factorial.rap f) Demonstrate the factorial.rap file to GATAs and run with different input values.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>

int main()

{

int n,fact=1,i=0;

do

{

printf("\n Enter a Positive number between 0 and 9:");

scanf("%d",&n);

}while(n<0||n>=10);

for(i=0;i<=n;i++)

{

if(i==0)

{

fact=1;

printf("\n%d!=%d",i,fact);

}

else

{

fact=fact*i;

printf("\n%d!=%d",i,fact);

}

}

}

//Raptor snapshot

//C program snapshot

I don't know how to send the Raptor Flow chart , If you provide u r mail or If you guide how to send then definitly i will send the raptor file

Thank you...

Add a comment
Know the answer?
Add Answer to:
(60-140) Lab Exercises #3-2 (Due at the end of the lab period) May. 28-30, 2018. Part...
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
  • Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program...

    Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program will calculate and display the total of all numbers up to a specific number (entered by the user). Only positive numbers are allowed. Part B: User-controlled loop Part A Input Validation loop Part A: Summation loop Examples: When 5 is entered the program will calculate the total as 1+2+...+5 and display 15. When 2 is enterered the program will calculate the total as 1+2...

  • COMP1410 - Lab Exercises #3 (Due at the end of the lab period or beginning of...

    COMP1410 - Lab Exercises #3 (Due at the end of the lab period or beginning of the next) Start Date: Oct. 1st, 2019 Objectives: Practice dealing with 2D arrays. Create a two dimensional array (e.g. int A2D[M] [N] ;) of size MXN to store integer values. Use #define M 4 and N 3 to start. (Using symbolic constants instead of hard coding the array sizes improves scalability). Create an interactive menu within main() for this program (call it Lab3.c) with...

  • CIST 2371 Introduction to Java Unit 03 Lab Due Date: ________ Part 1 – Using methods...

    CIST 2371 Introduction to Java Unit 03 Lab Due Date: ________ Part 1 – Using methods Create a folder called Unit03 and put all your source files in this folder. Write a program named Unit03Prog1.java. This program will contain a main() method and a method called printChars() that has the following header: public static void printChars(char c1, char c2) The printChars() method will print out on the console all the characters between c1 and c2 inclusive. It will print 10...

  • In this lab, you complete a partially written Java program that includes two methods that require...

    In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...

  • In this lab, you complete a partially written Java program that includes two methods that require...

    In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...

  • Student ID: 123 Write a C+ program with the following specifications: a. Define a C++ function (name it function_Student...

    Student ID: 123 Write a C+ program with the following specifications: a. Define a C++ function (name it function_StudentlD where StudentID is your actual student ID number) that has one integer input (N) and one double input (x) and returns a double output S, where N S = n 0 and X2 is given by 0 xeVn n 0,1 Хл —{2. nx 2 n 2 2 m2 x2 3 (Note: in the actual quiz, do not expect a always, practice...

  • please solve it before 11:15 today Subject :C++ programming - Lab_9_Sec 51.pdf 1411113: Programming for Engineers...

    please solve it before 11:15 today Subject :C++ programming - Lab_9_Sec 51.pdf 1411113: Programming for Engineers Fall 2017/2018 LAB #9 Name: ID: Date Section Objectives: After completing this lab, you will be able to .Analyze a problem. .Implement the solution in C++ . Practice arrays and strings. Lab Exc. Mark Score Correct input/output Computational correctness Correct input/output Computational correctness Exercise#1: Number of occurrences in an array Write a program that fills an array with 10 random numbers between 0 and...

  • c++ code Lab Exercises This assignment consists of two exercises. Exercise 1- Count Inversions Exercise Objectives...

    c++ code Lab Exercises This assignment consists of two exercises. Exercise 1- Count Inversions Exercise Objectives Define and call functions ✓ Using Array Using nested loop ✓ Using input/output statement Problem Description Inside "Lab2" folder, create a project named "Lab2Ex1". Use this project to write and run a C++ program that produces: Define a constant value called A_SIZE with value of 10. ► Declare an integer 10 array of size A_SIZE called Arr. Define a function called Read that accept...

  • PLEASE HELP!!! C PROGRAMMING CODE!!! Please solve these functions using the prototypes provided. At the end...

    PLEASE HELP!!! C PROGRAMMING CODE!!! Please solve these functions using the prototypes provided. At the end please include a main function that tests the functions that will go into a separate driver file. Prototypes int R_get_int (void); int R_pow void R Jarvis int start); void R_fill_array(int arrayll, int len); void R_prt_array (int arrayl, int len) void R-copy-back (int from[], int to [], int len); int R_count_num (int num, int arrayll, int len) (int base, int ex) 3. Build and run...

  • In C++ Programming Write a program in a file named SeedFinder.cpp that finds and displays all...

    In C++ Programming Write a program in a file named SeedFinder.cpp that finds and displays all the seeds of a integer given by the user. Let’s define a seed of an integer, n, to be a positive value that equals n when multiplied by its individual digits. For example, 23 is a seed of 138 because 23 × 2 × 3 = 138. 111 is an example of a seed of itself because 111 × 1 × 1 × 1...

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