What I want to do is have printf print a variable which will randomly generate either the number 1 or 2. But I want the number 1 and 2 to be printed as X and O, respectively.
So would there be some type of constant declaration I could put in this function that has it print 1 or 2 as X or O?Code:void printRndm(int input) //input is assigned to randomly generate either 1 or 2 { printf("%d", input); }
edit:
title should read: is it possible to assign a character to a number as a constant?