Question: Write a MATLAB program that implements the algorithm designed in the Topic 1 Non-Linear Flowchart and Creating a Flowchart assignments previously implemented in C. Compare
Write a MATLAB program that implements the algorithm designed in the Topic 1 "Non-Linear Flowchart" and "Creating a Flowchart" assignments previously implemented in C. Compare and contrast the C and MATLAB versions of your codes.
convert this to a matlab program
#includeint main() { int a; printf("Enter first number: "); scanf("%d", &a); int b; printf("Enter second number: "); scanf("%d", &b); int limit; printf("Enter limit: "); scanf("%d", &limit); printf(" First number: %d ", a); printf("Second number: %d ", b); int c; c = a + b; while(c <= limit) { printf("%d ", c); a = b; b = c; c = a + b; } return 0; }
also this one
#includeint main() { int balance; printf("Initial balance: "); scanf("%d", &balance); int transaction; transaction = 1; while(transaction != 0) { printf(" Balance: %d ", balance); printf("Enter transaction: "); scanf("%d", &transaction); balance += transaction; } printf("Have a nice day! return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
