Find the value in variable 'sum' after execution


Submit solution

Points: 10
Time limit: 10.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C

Find the value in variable 'sum' after execution of the below code

include <stdio.h>

int main() { int i=0; int sum = 0; while(i<20) { if(i%5==0) { sum+=i; } ++i; }

printf("\n sum=%d",sum); }


Comments


  • 0
    CBENU4CSE22461  commented on June 20, 2023, 2:45 p.m.

    int main() { int i=0; int sum = 0; while(i<20) { if(i%5==0) { sum+=i; } ++i; }

    printf("\n sum=%d",sum); }


  • 0
    RAJESHCB  commented on April 16, 2023, 11:03 a.m.

    include <stdio.h>

    int main() { int i=0; int sum = 0; while(i<20) { if(i%5==0) { sum+=i; } ++i; }

    printf("\n sum=%d",sum); }