Question

IN MATLABCHALLENGE ACTIVITY 25.5.1: For loops. Reset Write a for loop that prints from initialNumber to finalNumber. Ex: initialNumber-3 and finalNumber 1 outputs 3 -2 -1 0 1 I #include <stdio.h> 3 int main(void) t 4 int initialNumber; 6 int i; int finalNumber; initialNumber--5 11 for 12 13 14 Your solution goes heref printf(%d , i); return 161 17 5 Check Next

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

here is the complete code..

===============================================================

#include<stdio.h>

int main(void)

{

int initialNumber;

int finalNumber;

int i;

initialNumber = -5;

finalNumber = 6;

for(i = initialNumber; i<=finalNumber; i++)

{

printf("%d ", i);

}

return 0;

}


===============================================================

Sample Output:

-5 -4 -3 -2 -1 0 1 2 3 4 5 6 

===============================================================

KIndly Check and Verify Thanks..!!!

Add a comment
Know the answer?
Add Answer to:
IN MATLAB CHALLENGE ACTIVITY 25.5.1: For loops. Reset Write a for loop that prints from initialNumber...
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
  • for c CHALLENGE ACTIVITY 9.7.1: Decrement array elements. Write a loop that subtracts 1 from each...

    for c CHALLENGE ACTIVITY 9.7.1: Decrement array elements. Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex lowerScores = {5,0,2,-3) becomes {4.0, 1.0). 1 include <stdio.h> 3 int main(void) 0 const int SCORES_SIZE - 4; int lowerScores [SCORES_SIZE]: int i; for (1 - 0; i < SCORES_SIZE; ++) { scanf("%d", &(lowerScores[i])); /" Your solution goes here / { 15 for (i = 0; i...

  • CHALLENGE ACTIVITY 3.4.2: Detect number range. Write an expression that prints "Eligible" if userAge is between...

    CHALLENGE ACTIVITY 3.4.2: Detect number range. Write an expression that prints "Eligible" if userAge is between 18 and 25 inclusive. Ex: 17 prints "Ineligible", 18 prints "Eligible". 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class AgeChecker { public static void main (String [] args) { int userAge = 0; userAge = 17; if( /* Your solution goes here */ ){ System.out.println("Eligible"); } else{ System.out.println("Ineligible"); } return; }...

  • CHALLENGE ACTIVITY 5.71 String library functions. Assign the size of userinput to stringSize. Ex: if userinput...

    CHALLENGE ACTIVITY 5.71 String library functions. Assign the size of userinput to stringSize. Ex: if userinput is 'Hello output is: Size of user Input: 5 1 #include <stdio.h> 2 #include <string.h> 4 int main(void) { char user Input[50]; int stringSize; BO scanf("%s", userInput); /* Your solution goes here" printf("Size of user Input: %d\n", stringsize); return ; Run

  • please solve CHALLENGE ACTIVITY 5.3.3: While loop: Insect growth. Given positive integer numinsects, write a while...

    please solve CHALLENGE ACTIVITY 5.3.3: While loop: Insect growth. Given positive integer numinsects, write a while loop that prints that number doubled without reaching 200. Follow each number with a space. After the loop, print a newline. Ex: If numInsects = 16, print: 16 32 64 128 1 #include <iostream> 2 using namespace std; von WN int main() { int numInsects; cin >> numInsects; // Must be >= 1 /* Your solution goes here */ 11 return 0; 12 }...

  • This is for C program CHALLENGE ACTIVITY 6.5.1: Unit testing. Add two more statements to main0...

    This is for C program CHALLENGE ACTIVITY 6.5.1: Unit testing. Add two more statements to main0 to test inputs 3 and-1. Use print statements similar to the existing one (don't use assert) 1 #include <stdio.h> test 3 // Function returns origNum cubed 4 int CubeNum(int origNum) t 5 return origNum origNumorigNum; 6 b All tests passed 8 int main void) 10 printfC"Testing started\n"; printf("2: Expecting 8, got: %d\n", CubeNum(2)); 14 Your solution goes here 15 16 printfC Testing completed\n"; 17...

  • CHALLENGE ACTIVITY 13.1.2: Basic function call. Complete the function definition to output the hours given minutes....

    CHALLENGE ACTIVITY 13.1.2: Basic function call. Complete the function definition to output the hours given minutes. Output for sample program: 3.5 1 test passed All tests passed 1 #include <iostream> 2 using namespace std; 3 4 void OutputMinutesAsHours (double origMinutes) { 5 6 /* Your solution goes here */ 7 8} 9 10 int main() { 11 double minutes; 12 13 cin >> minutes; 14 15 OutputMinutesAsHours (minutes); // Will be run with 210.0, 3600.0, and 0.0. 16 cout <<...

  • 2. Pointer arithmetic: a) Write a printString function that prints a string (char-by-char) using pointer arithmetics...

    2. Pointer arithmetic: a) Write a printString function that prints a string (char-by-char) using pointer arithmetics and dereferencing. b) Write a function “void computeMinMax(double arr[], int length, double * min, double * max)” that finds the minimum and the maximum values in an array and stores the result in min and max. You are only allowed to use a single for loop in the function (no while loops). Find both the min and the max using the same for loop....

  • i have no idea how to do floating point comparison this is c programming CHALLENGE 3.16.1:...

    i have no idea how to do floating point comparison this is c programming CHALLENGE 3.16.1: Floating-point comparison: Print Equal or Not equal Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targetValue. Otherwise, print "Not equal". Ex: If targetValue is 0.3333 and sensorReading is (1.0/3.0), output is Equal 1 #include <stdio.h 2 #include <math.h> 4 int main(void)f 6 8 scanf("%lf", &targetValue); 1 test passed double targetValue; double...

  • CHALLENGE ACTIVITY 4.8.1: Simon says Simon Says" is a memory game where Simon outputs a sequence...

    CHALLENGE ACTIVITY 4.8.1: Simon says Simon Says" is a memory game where Simon outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore Upon a mismatch, exit the loop using a break statement. Ex: The following patterns yield a userScore of 4 simonPattern: RRGBRYYBGY userPattern: RRGBBRYBGY 1 import java.util.Scanner; 3 public class...

  • CHALLENGE ACTIVITY 3.5.1: Detect specific values. Write an expression that prints "Special number if specialNum is-99,...

    CHALLENGE ACTIVITY 3.5.1: Detect specific values. Write an expression that prints "Special number if specialNum is-99, 0, or 44. 1 import java.util.Scanner; 3 public class Find SpecialValue { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int specialNum; specialNum - scnr.nextInt(); POSLOVOU if (/* Your solution goes here */) { System.out.println("Special number"); else { System.out.println("Not special number"); Run View your last submission

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