What is going to be the output of the following program incl

What is going to be the output of the following program: #include voidfM (int m[10]) {for (int i = 0; i

Solution

#include<stdio.h>


void fM(int m[10])
{int i;
   for( i=0;i<10;i+=2)
   {
       m[i]=m[i]+2;
   }
}
int main()
{
   int iarray[10]={2,4,7,9,11,23};
   fM(iarray);
   printf(\"%d %d %d\ \",iarray[0],iarray[1],iarray[2] );

   return 0;
}

=============================

output:

4 4 9

It simply adde 2 to number at even position for 2 to 10;

 What is going to be the output of the following program: #include voidfM (int m[10]) {for (int i = 0; i Solution#include<stdio.h> void fM(int m[10]) {int

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site