#this code is logically correct but it gives no output

3 messages · Page 1 of 1 (latest)

grim daggerBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

mental bluff
#

!f

grim daggerBOT
#
#include <cctype>
#include <iostream>
using namespace std;
int main() {
  string fname;
  string mname;
  string lname;

  cout << "Enter First name: ";
  cin >> fname;

  cout << "Enter midlle name: ";
  cin >> mname;

  cout << "Enter last name: ";
  cin >> lname;
  int fnmaelen = fname.length();

  for (int i = 0; i < fnmaelen; i++) {
    char ch = fname[i];
    ch = toupper(ch);
    cout << ch;
  }
  cout << " ";
  int mnamelen = mname.length();

  for (int i = 0; i < mnamelen; i++) {
    char ch = mname[i];
    ch = toupper(ch);
    cout << ch;
  }
  cout << " ";

  int lnamelen = lname.length();

  for (int i = 0; i < lnamelen; i++) {
    char ch = lname[i];
    ch = toupper(ch);
    cout << ch;
  }

  return 0;
}
!Habib_Du