// july21ex2.cpp : Defines the entry point for the console application.
// This program produces random cap letters until two letters in a row
//  are the same

#include "stdafx.h"
#include "stdlib.h"
#include "time.h"

int main(int argc, char* argv[])
{   int num_chars = 0;

    char mychar='?', oldchar;

	srand(time(NULL));

	do {
          oldchar = mychar;
          mychar = rand() % 26 + 'A';
		  printf("%c", mychar);
		  num_chars++;


	}  while ( mychar != oldchar );

    printf("\n\nThe num of chars = %d \n", num_chars);

	return 0;
}