Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#define _CRT_SECURE_NO_WARNINGS #include #include int main() { int n, sum=0; printf(n= ); scanf(%d, &n); n = n > 0 ? n : -n; while (n

#define _CRT_SECURE_NO_WARNINGS

#include

#include

int main()

{

int n, sum=0;

printf("n= ");

scanf("%d", &n);

n = n > 0 ? n : -n;

while (n > 0) {

sum += n % 10;

n /= 10;

}

printf("%d", sum);

getchar(); getchar();

return 0;

}

write a c++ program for the following question

"random numbers"

Given an array dimension (n). Fill the array with random numbers in the range [ -100; 100]. Swap the values of zero and maximum of elements. To work with an array to use.

NB: the solution should be in the form as shown in an example below :

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_2

Step: 3

blur-text-image_3

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What are the types of defamation actions?

Answered: 1 week ago

Question

Please help EP9100 ALE 2- Team 11

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago