how to open terminal as administrator in ubuntu

C++
# in terminal type
sudo su
# now enter your login password sudo passwd root
Source

Also in C++: