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
1
Use of commas in the for loop (multiple initialization with command expressions),
Attachments:
Similar questions
Hindi,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Physics,
1 year ago
Biology,
1 year ago