Hello, I need to modify the following for statement , you can notice thatthe pri
ID: 3619107 • Letter: H
Question
Hello,
I need to modify the following for statement , you can notice thatthe printf statement will be repeated twice for every two objects..for example .. one time : " Enter number of messagesbetween 1 and 2 " and the other time " Enter number of messagesbetween 2 and 1" . Well, I need this statement one time .. eitherthe first one or the second one .
for( i = 0 ; i < 6 ; i++ )
{
for(j=0;j<6;j++)
if(i+1!=j+1)
{
printf("Enter number of messages between %d and %d:",i+1,j+1);
scanf("%d" , &signals[i][j]);
}
else
signals[i][j] = 0 ;
}
Explanation / Answer
please rate - thanks I included the code I used to test it change is highlighted in red #include #include int main() {int i,j,signals[10][10]; for( i = 0 ; i < 6 ; i++ ) { for(j=i;jRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.