Simple Code Issue

What is wrong with the way I input the code?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <string>
#include <iomanip>

using namespace std;
int main()
{
    //variables

const int daysOfClass==3;
int studentDaysInClass=2;
int attendanceGrade;
attendanceGrade==(studentDaysInClass/daysOfClass)*100;

cout<<attendanceGrade;

return 0;
}


The program outputs a random number instead of 66.
Last edited on
Line 13, what is the difference between == and =?
== means equal

= means assign

should I assign it instead?
Line 13 I switched equal to assign and the program outputted "0".
Line 10, same issue.

Also, what is 2/3 if you round down?
ok ill change them from integers to doubles. and switch them the operators to assign.
yooooooo ispil you are the best man!!!!
thanks so much
Topic archived. No new replies allowed.