log user off from c prog

ok, heres what i want i need....well want, hehe...

in a program, its a simple menu, i need to log the user running the program off...back to the login prompt. this is not a super user, just a normal account.

i know i could just set the program to be the users login shell..but i'd rather do it this way. im not sure if this is possible. and i know it may not be that secure. but is there a way to do this?

if its not possible from within a c prog, what about from a shell script?

any one? :confused:

The program would have to run as either root, or the user you're killing. Simply kill the shell, and the rest should die (unless they've been told not to - in which case you have to kill each one).