1 solutions

  • 0
    @ 2025-11-5 14:57:11

    C :

    #include<stdio.h>
    int main()
    {
    	int i,s=0;
    for(i=1;i<=100;i=i+2)
    {
    	s=s+i;
    }
    printf("%d\n",s);
    return 0;
    }
    
    

    C++ :

    #include <iostream>
    using namespace std;
    int main()
    {
    	int a=0;
    	for(int i=1;i<=100;i+=2)
    	a=a+i;
    	cout<<a<<endl;
    	return 0;
    }
    
    

    Pascal :

    program aa;
    var a,d,b,c,e,max,min:longint;
    begin
     b:=1;
     c:=0;
     for a:=1 to 50 do
     begin
      b:=b+2;
      c:=c+b;
     end;
     e:=c-100;
     write(e);
    end.
    
    • 1

    Information

    ID
    16258
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By