C/C++ help please:3 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

C/C++ help please:3

https://code.sololearn.com/ckXTEIg976AX/?ref=app So guys This program should change sigh (from + to - and backward from - to +) for maximally module element from massive. I have some code, but I don’t know what I have to do next. Please help.:з

18th Oct 2019, 5:49 PM
Qwerty Chan
Qwerty Chan - avatar
5 Answers
+ 1
You code confuses me. if you do a printf("mas[%i]= ",i); scanf("%i",&mas[i]); printf before a scanf, how can you print numbers. printf("mas[%i]= ",i); This printf prints the value of i, the counter of the for loop not the value of the element in the array. Have a look at my code. https://code.sololearn.com/c91i9qvbIn6N The good news if you can print negative numbers. printf("mas[%i]= \n",mas_min[i]); Sorry if I misunderstood your code Keep coding.
22nd Oct 2019, 9:29 PM
sneeze
sneeze - avatar
+ 4
Please explain more. What is your wanted output ? What does your code do right now ? What does your code do you need to add ?
18th Oct 2019, 8:06 PM
sneeze
sneeze - avatar
+ 4
You can change signs of numbers by multiplying them with -1, if that's what you want.
22nd Oct 2019, 3:31 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 1
i want output by printf. this code almost done, but it displays without changing the sign
22nd Oct 2019, 8:54 AM
Qwerty Chan
Qwerty Chan - avatar
+ 1
i use this (for(i=0;i<10;i++) { printf(“mas[%i]=“,i); scanf(“%i”,&mas[i]); }) cause i wanna input elements by user anyway i made this. and it was easy. thx u, guys:3
22nd Oct 2019, 10:25 PM
Qwerty Chan
Qwerty Chan - avatar