- Prepare
- C++
- Introduction
- Basic Data Types
- Discussions
Basic Data Types
Basic Data Types
+ 0 comments /* The Question Should Have Specified That We Need To Set Precision For The Values Of Float & Double, I just wrote the simpler code like everyone and It did not work on the other test questions, I tried the questions 4-5 Times until I realised My code was not printing decimal values after some 3 or 4 digits then I came to know that I do have to set a precision value which I ultimately had to and I didn't how to, Googled It, learned something new from this question, here's my solution. */
include
include
include
using namespace std; int main() { int x; long y; char a; float z; long double d; cin >> x; cin >> y; cin >> a; cin >> z; cin >> d; cout << x <<"\n"; cout << y <<"\n"; cout << a <<"\n"; cout << fixed << setprecision(3)<< z <<"\n"; cout << fixed << setprecision(9)<< d <<"\n";
return 0;
}
+ 2 comments c++
#include <iostream> #include <cstdio> #include <iomanip> using namespace std; int main() { // Complete the code. int a; long b; char ch; float f; double d; std::cin>>a>>b>>ch>>f>>d; std::cout<<a<<endl; std::cout<<b<<endl; std::cout<<ch<<endl; std::cout<<fixed<<setprecision(3)<<f<<endl; std::cout<<fixed<<setprecision(9)<<d<<endl; return 0; }
+ 0 comments lolooking for softwere courses:
[Data Science Programs In Chennai](https://shiash.com/data-science-program.php )
[Internship Programs In Chennai](https://shiash.com/internship.php )
+ 0 comments include
using namespace std; int main() { int x; cin >> x; long b; cin >> b; char a; cin >> a; float c; cin >> c; double d; cin >> d; cout << x << endl; cout << b << endl; cout << a << endl; cout << c << endl; cout << d << endl; return 0; }
+ 0 comments include
include
include
using namespace std;
int main() { int a; long b; char c; float d; double e;
scanf("%d %ld %c %f %lf", &a, &b, &c, &d, &e); printf("%d\n%ld\n%c\n%.3f\n%.9lf\n", a, b, c, d, e); return 0;
}
Sort 1384 Discussions, By:
Please Login in order to post a comment