Why this program is error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why this program is error

I wrote the program by using setw(). But it show an error. #include <iostream> using namespace std; int main() { int name; cout <<"\n enter your name:"; cin >>name; cout <<setw(13)<<"\nyour name is"<<setw(8)<<name; return 0; }

10th Jan 2021, 4:49 AM
Jawahirullah
Jawahirullah - avatar
4 Answers
+ 7
M Jawahirullah you just forgot to put-> #include <iomanip> it should be working correctly after putting that. Next time put your code in code bits with private and share it while making another question, if you get stuck
10th Jan 2021, 4:57 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 12
#include <iomanip> include this as said by Coding kitty //I got a bit late but mark coding kitty/Pawan sir's ans as best😄
10th Jan 2021, 4:58 AM
Aditya
Aditya - avatar
10th Jan 2021, 5:02 AM
P∆WAN M∆URY∆
P∆WAN M∆URY∆ - avatar
+ 7
Please share your snippet
10th Jan 2021, 4:50 AM
Aditya
Aditya - avatar