There is a funciton in #include <cctype> called isupper(ch), ch is a char variable, that returns true if ch is an uppercase character, false otherwise.
Answers like these to questsions like these make me sad.
OP Title wrote:
how can i make a programm that has as input only capital letters
You can't - not without using a library like ncurses to modify the input as it is typed. And trust me, this is not worth the effort to do, so just don't do it. Learn to live with people who don't type in all caps for your programs.
Caps lock won't work if the user presses shift. biplav's method is best.
That was a joke of course. I was also assuming that the OP wanted to modify the input stream, not just convert (toupper). It's a moot point I guess since the OP has not returned...