print in same line

want to print integer and string in same line for example
12 23 Alexander 34

write like this

cout<<val1<<" “<<val2<<” “<<string<<” "<<val3<<endl;

//