Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the complete runtime function for the attached program SUMODD for each statement write c1, c2 etc and where appropriate n, n-1 etc follow the

Write the complete runtime function for the attached program SUMODD for each statement write c1, c2 etc and where appropriate n, n-1 etc follow the bubble sort example

#include using namespace std; int main() {

int N=0, sum=0;

for(int k=0; k<5; k++) { cout<<"enter an integer "<>N; if(N%2==1) sum = sum+N; } cout<<"sum of odd numbers "<

return 0; }

//Bubble sort example #include

using namespace std; int main() { int k=5, hold; //c1 int a[5] = {3, 8, 2, 1, 9}; //c2 for (int pass=0;passa[j+1]) //c5*(n-1)*(n-1) { hold =a[j]; //c6*(n-1)*(n-1) a[j]=a[j+1]; //c7*(n-1)*(n-1) a[j+1]=hold; //c8*(n-1)*(n-1) } } for (int p=0;p

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions