I am trying to run the below code using for loop but i am getting syntax error. Please help.
Input Format: The first line of the input contains an i
This will work. However you should insert some helper messages inside:
#!/bin/bash read n sum=0 for (( i=1; i<=n; i++ )) do read val ((sum^=val)) done echo $sum