Computer Science, asked by Ryan9682, 1 year ago

Write a program to print the sum of first 50 odd numbers

Answers

Answered by ihsaanwant
0

mark as brainliest. Please!

  For(int i=1;i<=50;i=i+2)

   {

         printf("%d\n ",i );

   }

Here \n is used to enter new line.

In first step it will print 1 , and will enter new line.

In second step it will increase I by 2 ,,, thus I = 3

… Now it will print 3 and will enter into new line...

By this way complete output will be like this:

1

3

5…

Thanks.

Again, mark as brainliest.


AdishaDeo: hey in the programme it must be i+=2 not i=+2
Answered by shivamraikuni
0

I n which program language do you want..???

Similar questions