We have %x in C to print any decimal value as hex value like this
printf("%x",a); // here a is having some integral value
Similarly, can we print this directly in C++ without any much extra effort or without addition of extra header file like <iomanip>?
You need
<iostream>for C++ style output anyway, so it’s not an “extra” header.