addition of two negative numbers using signed 10's complement the question given was:-
(-9742)+(-641)
since we take the complement of the negative numbers, the 10's complement of first number was 258 and for the second it was 9359, but after adding both of these two complements the result is 9617 to which i further subtract by the 10000 to get -383. i wanted to know where i am going wrong because the correct answer will be -10383? is my approach wrong? if yes, then what's the correct method?
 A: Your problem is that the computation overflows when you're using only 4 digits. Even your input is out of range: Representing $-9742$ as 0258 leaves no clue that the original input was actually $-9742$ rather than $258$.
The way out of this is to use enough digits that both the inputs and the result has a sign digit at the front. With 5 digits
$$ (-9742)+(-641) = ? $$
gets represented as
$$ \mathtt{90258} + \mathtt{99359} = {}_1\mathtt{89617}$$
where the small ${}_1$ denotes a carry out that you ignore because you're working with a word lenght of 5 digits only.
Assuming there was no overflow (which there isn't in this case, though it might have been prudent to use yet another digit), the leading 8 tells us that the result is negative (if we're assuming a symmetric overflow interval this is the case when the leading digit rounds up).
We can then translate 89617 back to what it represents: $89617-100000=-10383$ as it should be.

This assumes that you're using 10s complement as a didactic tool to understand computer arithmetic, which uses 2s complement with fixed word length. If we're approaching this from a more mathmematical angle, the principled thing would be to have infinitely many digits, with numbers stretching to the left as long as the digits are eventually all 9 or eventually all 0.
(In fancier words, this corresponds to calculating with the homomorphic image of $\mathbb Z$ in the 10-adic integers).
We would then represent
$$ (-9742) + (-641) = {?} $$
as
$$ {.}{.}.9990258 + {.}{.}.999359 = {.}{.}.99989617 $$
and then we don't need to hedge stuff about overflow, because this result unambiguously represents $-10383$.
A: Let $a=9742$ and $b=641$. Then you have computed
$$
(10^4-a)+(10^4-b)=2\cdot 10^4-a-b
$$
and subtracted $10^4=10000$ to have
$$
10^4-a-b=-383
$$
If you subtract another $10^4=10000$, you should be good. Each time you have used a $10$'s complement, you have added a power of $10$. All of those powers of $10$ must be subtracted in the end.

For negative numbers though, it seems simpler to compute
$$
\begin{array}{rl}
9742&+\\
641&\\
\hline
10383
\end{array}
$$
and then simply change the sign afterwards.

Last alternative:
$$
10000-9742=258,\quad1000-641=359
$$
and
$$
258+359=617
$$
which has complement
$$
1000-617=383
$$
which yields $617-1000=-383$ from which we then still need to subtract the $10000$ from the first $10$'s complement. So you even do not have to use the same power of $10$, as long as you keep track. Here we have subtracted $1000$ and $10000$ respectively from the sum $617$ achieved using the complements with these powers of $10$ respectively.
