You can check if a number is prime in C++ by iterating from 2 to the square root of the number and checking if it is divisible by any of the numbers in that range. If it is divisible by any number, it is not prime; otherwise, it is prime.