Question: I need help fixing my code so that it looks like the output example in the instructions using for loops in C. Especially where it

I need help fixing my code so that it looks like the output example in the instructions using for loops in C. Especially where it prints the odd integers. I need help fixing my code so that it looks like theoutput example in the instructions using for loops in C. Especially whereit prints the odd integers. Must look exactly like this example usermimir:

Must look exactly like this example

usermimir: -/cpsc1010_s21/chapterproject_42 > gcc -Wall C4.2.c user@mimir: -/cpsc1010 s21/chapterproject_42 > ./a.out Enter two integers. First number must be less than the second number you enter Enter 2 integers numbers: 10 20 Sum of the squares of odd integers between 10 and 20 = 0 odd integers between 10 and 20 are: 17 7 #include 8 int main() 9-{ 10 int firstNum; 11 int secondNum; 12 int sum=; 13 int i; 14 15 printf("Enter two integers. "); 16 printf("First number must be less than "); printf("the second number you enter "); 18 printf("Enter 2 integers numbers: "); 19 scanf("%d %d",&firstNum , &secondNum); 20 21 for(i=firstNum; i>=secondNum; i++) 22 { 23 if(1%2==1) 24 - { 25 sum-=1*i; 26 } 27 ] 28 printf(" Sum of the squares of odd integers between %d and %d = %d ", firstNum, secondNum, sum); 29 printf("Odd integers between %d and %d are: ", firstNum , secondNum); 30 31 for(i=firstNum;i>=secondNum; i--) 32 { 33 if(i%2!=0)//CHECKING FOR ODD NUMBER 34 { 35 printf("%d", 1); 36 } 37 if(i%2==0)//CHECKING FOR EVEN NUMBER 38 - 39 sum+=i; 40 } 41 ] 42 printf(" Sum of even integers between %d and %d = %d " ,firstNum , secondNum, sum); 43 printf("Number Square of Number "); for(i=firstNum;i 42 printf(" Sum of even integers between %d and %d = %d " ,firstNum, secondNum, sum); printf("Number Square of Number "); for(i=firstNum;i=97; i--) printf("%c ",1); printf(" "); Create program that uses for loops to perform the same steps as C4.1 (well, almost the same): Prompt the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum) Output the sum of the square of the odd integers between firstNum and secondNum Output all odd integers between firstNum and secondNum, in descending order Output the sum of all even integers between firstNum and secondNum Output the integers and their squares between firstNum and secondNum, in ascending order Output all the lowercase letters in descending order (be sure to use a for loop All ranges include the end points (firstNum and secondNum). For example: Enter two integers. First number must be less than the second number you enter Enter 2 integers numbers: 10 20 Sum of the squares of odd integers between 10 and 20 = 1165 Odd integers between 10 and 20 are: 19 17 15 13 11 Sum of even integers between 10 and 20 = 90 Number Square of Number 10 100 11 121 12 144 13 169 14 196 15 225 16 256 17 289 18 324 19 361 20 400 Lower case letters are: z y xw vu tsr a pon ml kj i hgfedcba

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!