concatenate empty

Description:

Write a simple C++ program to concatenate the 3 strings given by the user by using classes and objects. If any of the string is empty, it should print as "Invalid Input" otherwise it should print the concatenation of those 3 strings Test Case 1 Input (stdin) bala raja kum Expected Output balarajakum Test Case 2 Input (stdin) rajiv kumar a Expected Output rajivkumara

Program :

#include <iostream>

#include<string.h>

using namespace std;

int main()

{

char a[50],b[50],c[50];

  cin>>a>>b>>c;

  if(a[0]<58 || b[0]<58 || c[0]<58)

    cout<<"Invalid Input";

  else

  {

  strcat(a,b);

  strcat(a,c);

  cout<<a;

  }

return 0;

}