Question: #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

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!