i was wondering how i would get the total for the numbers of 5-25 and print it out; so it would print out 315; im blanking out

            for (int a = 5; a <= 25; a++)
            {
               int total = 0;
                total= a + a;
                Console.WriteLine("total= " + a);
            }

Hi Jasdeep11 welcome. :)
Do it like this:

int total = 0; //initialize sum outside the for loop
            for (int a = 5; a <= 25; a++)
            {  
                //add variable a every time to the total you already have
                //and store it again in total
                total = total + a;               
            }
            //after the for loop, write out the total
            Console.WriteLine("total= " + total);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.