+ 3
If I write b[a[i]] =a[i] I got error in code
Why it cause error
10 Respuestas
+ 9
'array subscript is not an integer'
This message tells you, that value you pass as index must be converted to int type (you pass double)
+ 8
Maybe you forgot ';'
It is hard to guess until you show full code with this line
+ 7
%f
+ 5
Yes
+ 2
Thanks bro
+ 1
https://code.sololearn.com/cD66pB1ZTD1K/?ref=app
This is the code bro
+ 1
If I got a int value I use %d if I got double value what I wanna to use
+ 1
If I pass double what I have to get bro
+ 1
Its a float sign is this equal to double also
+ 1
Hello Mano Vijay,
(Note: @ = Line number)
Efficiency speaking, why allocate 100 elements for <a> & <b> @7 while you ask for number of elements <n> @15? allocate <a> & <b> as much as <n> input.
@10 <b> array contains 100 elements, indexed 0-99, your loop should be for(i=0; i<100; i++)
@19 <a> is of double type, use %lf as format in scanf
@28 You can't use floating numbers for indexing array. <a> is of double type, b[a[i]] you are pointing to an element in <b> using <a> which is double (floating number).
@34 if(b[i]!='s') <b> is of double type, and here you are comparing with char.
@36 printf("%d",b[i]); use %lf for printf format