0
What's Mistakes in this code....?? 🤔
#include <iostream> using namespace std; int main() { int O; int P; cout <<"Enter Your Obtained Marks: "; cin >> O; P = (O/1100)*100; if(P>=33) cout <<"Your are PaSS"; else cout <<"Your are Fail"; return 0; }
3 Respostas
+ 4
Division between two integers result in an integer. You should do
P = (float) O / 1100 * 100;
instead. Also there are grammar mistakes.
+ 2
There doesn't appear to be a technical mistake in the code. What is supposed to happen/ What is the program supposed to do? Maybe provide some sample input and output.
0
Just to add to Airree's answer: declare P as float.