00:01
Hello students, we need to write a c plus program to find the summation of odd numbers between 0 and 1000.
00:07
Right.
00:08
So we need to sum all the numbers that come between 0 to 1000 but which are odd.
00:13
So what are odd numbers if i write here? odd numbers are the numbers are the numbers which are not divisible which are not divisible by 2.
00:32
We divide that numbers by 2 then we will have the reminder if i get that reminder it means n percentage 2 is 1 so what does it mean it means we take an example then if we divide 3 by 2 then this is the reminders and then reminder will be 1 it means these numbers are odd numbers now let us start our programming part so let's start with our program so our program says let's start with our program so now we need to include hash include stdio .h.
01:06
Basically now in the c+ + program we need to include one more library which is i .o stream which is i .o.
01:16
Stream.
01:17
Now we need to write our function which is in domain and we need to write our program.
01:25
Now let's start.
01:26
So what we need to do is we need to initialize some web.
01:30
Or constant.
01:32
So we need to write here int and right and we can write here into a is equal to 0 and b is equal to 1000 right what does it represent? lowest number is zero and highest number is thousand right so our number between them so i can write here and is the number and is the number between zero and thousand we need to check right now what we need to do is we can write here end submission so add is equals to zero we can assign here moreover if we got any variable or constant we will definitely declare according to use now we need to print a value c out we need to print a value actually we don't need to print any message we directly use our sum method so we use here for lobe to find the sum let's start our 4 loop.
02:35
In the first case we need to write here n is equal to a.
02:40
Start with this n value is less than b...