Gargit

Variables Exercise Part 7

Jul 26th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctype.h>
  3.  
  4. void main()
  5. {
  6.     char firstChar, secondChar, halfwayChar;
  7.     std::cout << "Enter first char: ";
  8.     std::cin >> firstChar;
  9.     std::cout << "Enter second char: ";
  10.     std::cin >> secondChar;
  11.     firstChar = tolower(firstChar);
  12.     secondChar = tolower(secondChar);
  13.     halfwayChar = (firstChar + secondChar) / 2;
  14.     std::cout << "The letter half way in between those is: " << halfwayChar << std::endl;
  15.     system("pause");
  16. }
Advertisement
Add Comment
Please, Sign In to add comment