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.:з
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.
+ 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 ?
+ 4
You can change signs of numbers by multiplying them with -1, if that's what you want.
+ 1
i want output by printf.
this code almost done, but it displays without changing the sign
+ 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