int or double?

Hi, my code below can function with int or double, so may I know any different between them?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <conio>

int main ()
{
	int mark;

   cout<<"Enter your mark>>";
   cin>>mark;

   if (mark>=75)
     	cout<<"Your Score: A"<<endl;

	if  ((mark<75) && (mark>=60))
   	cout<<"Your Score: B"<<endl;

   if  ((mark<60) && (mark>=45))
      cout<<"Your Score: C"<<endl;

   if  ((mark<45) && (mark>=30))
      cout<<"Your Score: D"<<endl;

   if  (mark<30)
      cout<<"Your Score: E"<<endl;

   getch();
   return 0;
}
so may I know any different between them?
What are you asking, should you know the difference between and int or a double? It can function with either because it is implicitly converting any double/float value you enter to an int.
I not really understand about int, double, word, and long, can u briefly explain it with a simple example? really thanks for the answer^^
Topic archived. No new replies allowed.