# Read n & m, display the sum of all the even and odd numbers between n to m.

Sample output
enter 1st no:3
enter 2nd no:
sum of even nos:10
sum of odd nos:12

Posted by on

• Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that gotĀ 5 achievements.

Governor:

An expert whose answer gotĀ voted for 20 times.

Scholar:

An expert who has written 20 answers of more than 400 characters.

• Expert

#include <stdio.h>

int main()
{
int n1, n2, i;
int sum = 0;
n1 = 3;
n2 = 11;

for (i = n1; i <= n2; i++) {
if (i % 2 == 0) {
sum = sum + i;
}
}
printf("sum = %d\n", sum);
return 0;
}

Posted on Feb 21, 2008

Hi there,
Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017

×

my-video-file.mp4

×

## Related Questions:

### How can i display an even number if i enter an odd number in visual basic 6.0

To display an even number when an odd number is entered you can add 1.
n= val(text1.text) 'Take the value of n from the textbox.
If n mod 2 =1 then 'If n is an odd number n=n+1 'You make it an even number end if
text2.text = n 'Display it in another textbox.

Please give a good rating to this answer so that I will be encouraged to support people like you having problems with VB6.

Sep 22, 2011 | Computers & Internet

### How do I put my calculator in statistics mode?

The TI-30XA does not have to be switched to a statistics mode, the operations are available all the time. The choice of operations are somewhat limited; the calculator offers statistics functions for one dimensional data sets only (no linear interpolation of (x,y) value pairs, for example):
• [2nd] [CSR] - erase statistics data
• [] - add a number to the sample set
• [2nd] [] - remove a number from the sample set
• [2nd] [FRQ] - multiple entry of the same sample value
• [2nd] [n] - sample set size
• [2nd] [] - sum of all sample elements
• [2nd] [] - sum of the squares of all sample elements
• [2nd] [] - average of the sample set
• [2nd] [] - standard deviation (sample set is a complete set)
• [2nd] [] - standard deviation (sample set is a subset of a larger set)
The calculator displays "STAT" if the current sample set is non-empty.

Example: calculate the average and standard deviation of the set { 3, 4, 5, 5, 5, 5, 6 }.
1. [2nd] [CSR] - erase stat memory
2. 3 [] 4 [] 5 [2nd] [FRQ] 4 [] 6 [] - enter the data, note the use of [2nd] [FRQ] to enter the four occurrences of "5". Entering 5 [] four times would have done the same.
3. [2nd] [] - display the average of the set, (4.714...)
4. [2nd] [] - display the standard deviation of the set (0.8806...)

Jan 25, 2011 | Texas Instruments TI-30XA Calculator

### Out of 1,3,5,7,9,11,13,15,17,19 pick up any 5 nos. to make a total of 50.

Several ways to do this. 1, 5, 13, 15 17 is one of them.

(1 x 5) + 13 + 15 + 17

Workings:

(1 x 5) = 5

5 + 13 + 15 + 17 = 50.

- You cannot add five odd numbers together to make 50. Five odd numbers added together will always be an odd number.
- You cannot add four odd and take an odd number away as this will also total an odd number.

Therefore 2 of the numbers must be multiplied as this enables you to effectively add four odd numbers together to total an even number.

Hope this helps. Got any more?

Jan 13, 2011 | Vacuums

### Can i do statistics on the casio fx-115 es? and how can i use it?

Yes and here is how to do 1-var statistics and 2-var statistics. Please read the whole post. I assume you know the theory. I will show you the key strokes

For 1-Var statistics
Press [MODE][3:STAT] [1:1-VAR]. You are ready to enter values in the X column.
Enter a number and press [=]. Cursor jumps to second number to enter.
Keep entering numbers and pressing [=] till all numbers are in. Press the [=] key after the last one.
Press [AC] key to clear the screen.
Press [SHIFT] [STAT] (above digit 1.) then [5:Var]. Screen displays the statistical variables 1:n ;2: x bar; 3: x sigma n; 4:x sigma n-1.
Press the number corresponding to the statistical value you want, ex 1:n . The variable appears on screen. Press [=] and it will be displayed.
To display another variable press [SHIFT][STAT][5:Var][ 1,2, 3, or 4] .

To access the sum of squares sigma x^2 and the sum of data sigma x press[SHIFT][STAT][4:SUM] then [1: for sigma x^2] or [2: for sigma x]. Press [SHIFT][STAT][6:MinMax] to access minX and maxX.

For 2-var statistics
To perform 2 variable statistics you press [MODE][3:STAT] and any of the other regression options (except 1:1-Var). A two column template opens where you enter the X and Y values. When finished entering data, press [SHIFT][STAT][5:Var]. to access the different statistics. As I assumed above, you should be able to recognize what each variable means.

Nov 06, 2010 | Casio FX-115ES Scientific Calculator

### How do I get the variance, the standard deviation, and the sample standard deviation in a casio FX-115Es.. Thank you

The variance is the square of the standard variation

TO COMPUTE STANDARD DEVIATION AND 2-VAR STATISTICS.

I assume you know the theory. I will show you the key strokes

for 1-Var statistics
Press [MODE][3:STAT] [1:1-VAR]. You are ready to enter values in the X column.
Enter a number and press [=]. Cursor jumps to second number to enter.
Keep entering numbers and pressing [=] till all numbers are in. Press the [=] key after the last one.
Press [AC] key to clear the screen.
Press [SHIFT] [STAT] (above digit 1.) then [5:Var]. Screen displays the statistical variables 1:n ;2: x bar; 3: x sigma n; 4:x sigma n-1.
Press the number corresponding to the statistical value you want, ex 1:n . The variable appears on screen. Press [=] and it will be displayed.
To display another variable press [SHIFT][STAT][5:Var][ 1,2, 3, or 4] .

To access the sum of squares sigma x^2 and the sum of data sigma x press[SHIFT][STAT][4:SUM] then [1: for sigma x^2] or [2: for sigma x]. Press [SHIFT][STAT][6:MinMax] to access minX and maxX.

For 2-var statistics
To perform 2 variable statistics you press [MODE][3:STAT] and any of the other regression options (except 1:1-Var). A two column template opens where you enter the X and Y values. When finished entering data, press [SHIFT][STAT][5:Var]. to access the different statistics. As I assumed above, you should be able to recognize what each variable means.

Oct 27, 2010 | Casio FX-115ES Scientific Calculator

### 9999555533331111 out of these numbers any 6 numbers total is 21? how

this would be explained on the basis of two FACTS below.......
sum of two odd numbers are always even and
sum of to even numbers are also always even

then how 6 odd numbers (consider 3 pairs, 9 5 3 1 being odd numbers) can make an odd number 21..!!
SO SIMPLE

Aug 14, 2010 | Computers & Internet

### Where can i find an example program of visual basic that can input an odd and even number and can display the result of highest even and highest odd number and can sort them from minimum to maximum

http://www.microsoft.com/visualstudio/en-us/products/teamsystem/default.mspx?pt_id=-1&WT.mc_id=B66C779D-0907-4EE1-9435-FED85F10C8E2&WT.srch=1&wt.mc_id=vspdsrch

Apr 16, 2009 | Microsoft Visual Basic Professional...

### How to sum series

Click on the Mode button twice until you see “SD”. Select 1. This puts the calculator in Statistics Mode. Enter the first number, 1.
Hit the M+. (n= 1 will appear in the window)
Enter the second number, 1.
Hit the M+ key. (n=2 will appear in the window)
. . . . .
Enter the last number, 7.
Hit the M+ key. (n=7 will appear in the window)
Hit shift, 2. (This invokes the S-Var option.)
Hit 1 for the sample mean. Hit Enter.
Hit 3 for the sample standard deviation that we will use in class. Hit Enter. here you can also ffind the sum of all numbers

Jan 21, 2009 | Casio FX-300MS Calculator

### Pls. help me

Q.2#  Dim n, sum as Double
Dim i as Integer
n=100
sum=0

for i=1 to n
sum=sum+1/n
next i

Q.3#  Dim sum as Double
sum=0
for i=1 to 99
if i%2 <> 0 then sum=sum+i end if
next i

Sep 16, 2008 | Microsoft AccRepair DS2 2004 for Fr...

## Open Questions:

#### Related Topics:

135 people viewed this question

Level 3 Expert

Level 3 Expert