Computer Science, asked by TbiaSamishta, 1 year ago

Use of commas in the for loop (multiple initialization with command expressions), correct the program for given output:
#include
main()
{
int num, total, squre, cube;
for(total = 0, squre = 0, cube = 0, num = 1; num<=5;++num)
{
total = total + num;
squre = squre + num*num;
cube = cube + num*num*num;
}
printf(""Total = %d\n"",total);
printf(""Squre = %d\n"",squre);
printf(""Cube = %d\n"",cube); }
}

Answers

Answered by Secondman
1

Use of commas in the for loop (multiple initialization with command expressions),

Attachments:
Similar questions