0

How identify operator in C???

Input = two integers 34 +/-/*/÷ 24 =??? How can you identify the operator and will get output = 34 + 24 = .... (if the operator you input is +) If you input = 34 - 24 Output= 34 - 24 =... ( if the operator you input -)

25th Feb 2019, 1:27 PM
Karna
Karna - avatar
1 Respuesta
+ 1
A possible solution, is to use strpbrk(), strstr(), etc.. (in string.h library) Or you can write your own code for doing such task. Here: https://code.sololearn.com/cXdKsbR95Fju/#c is an example with strpbrk() Hope that helps... :)
25th Feb 2019, 3:07 PM
unChabon
unChabon - avatar