printf("\ enter the value of ")scanf("% "& )do sum sum ii while( <= )avg (float)sum/nprintf("\ the sum of first % numbers % ",nsum)printf("\ the average of first % numbers "navg)return output enter the value of the sum of first numbers the average of first numbers for loop like the while and do-while loopsthe for loop provides mechanism to repeat task till particular condition is true the synax and general form of for loop is given in fig initialization of loop variable syntax of for loop for (initializationconditionincrement/decrement/updatestatement blockstatement ycontrolling condition for loop variable false true statement block update the loop variable statement figure for loop construct when for loop is usedthe loop variable is initialized only once with every iterationthe value of the loop variable is updated and the condition is checked if the condition is truethe statement block of the loop is executedelse the statements comprising the statement block of the for loop are skipped and the control jumps to the statement following the for loop body in the syntax of the for loopinitialization of the loop variable allows the programmer to give it value secondthe condition specifies that while the conditional expression is truethe loop