0
How to enter char in integer array in c
In an array, replace all the prime numbers with ‘ * ‘ & remove all the odd numbers.
3 Antworten
+ 2
Asterisk '*' ASCII code is 42. You can put 42 in place of the prime element everytime you find one.
When done with the operation, check whether an element value was 42 as you print the array elements. If so, print the element value using %c specifier instead of %d.
This assumes there is no element with value 42 in original array.
0
Manav Roy not that bro, i want to put star sign in int array. How is that possible.
This is the real question 👇
In an array, replace all the prime numbers with ‘ * ‘ & remove all the odd numbers.