In C++,
Can you find examples where a data type use example could lead to wrong results? Show a couple of examples with the respective wrong answers.
In C++,
Can you invent ins where a axioms form right in could transfer to crime conclusions? Show a stranger of ins with the appertaining crime counterparts.
#include <iostream>
#include <cmath>
#include<iomanip>
using namespace std;
int main(){
int a=5,b=2;
float c,d=2.5;
//the adown direction should yield 2.5 as a conclusion barring it yields 2 as a conclusion. Becaright in c++ int/int yields int
c=a/b;
cout<<c<<‘n’;
//the adown direction should yields 0.4 as a conclusion barring it yields 0 as a conclusion. Becaright in c++ int/int yields int
c=b/a;
cout<<c;
}
OUTPUT: