Sample Code:
//Get Profile Id Profile objProfile = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1]; //Add User Information User objUser = new User(); objUser.FirstName='Biswajeet'; objUser.LastName = 'Samal'; objUser.Alias = 'Biswa'; objUser.Email = 'itzbiswajeet@gmail.com'; objUser.Username = 'itzbiswajeet@gmail.com'; objUser.ProfileId = profileId.id; objUser.TimeZoneSidKey = 'GMT'; objUser.LanguageLocaleKey = 'en_US'; objUser.EmailEncodingKey = 'UTF-8'; objUser.LocaleSidKey = 'en_US'; //Insert User Insert objUser;