Answer:
#include <iostream>
using namespace std;
int main()
{
char fullname[30];
string fname="",lname="";
int i,j;
cout<<"Enter fullname\n";
cin.getline(fullname,30); //so that blank can be read
for(i=0;fullname[i]!=' ';i++)
fname+=fullname[i]; //fistname will be saved
cout<<"\n";
for(j=i;fullname[j]!='\0';j++)
lname+=fullname[j]; //lastname will be saved
cout<<"\nFirstname : "<<fname<<"\nLastname : "<<lname;
return 0;
}
OUTPUT :
Enter fullname
John thomson
Firstname : John
Lastname : thomson
Explanation:
cin.getline() should be used instead of cin in case of strings so that space can be read otherwise after blank string will be ignored.
Answer:
A black screen with green text in the top left corner
Explanation:
Answer:
B. word processing
Explanation:
The appropriate software to use for creating research papers is word processing. This refers to any software that is designed with the main function of the production, storage, and manipulation of any kind of text document that is located on a computer or word processor. One of the most popular software example is Microsoft Studio's Word Processor from their Office Software Suite.
Answer:
The base case condition should be (x <= 0) instead of (x = = 0)
Explanation:
The given recursive function works fine for positive number. However, it returns an error when the value passed to the function is negative.
To prevent this, the base case should be x <= 0.
This will allow the program returns 0 if a negative number or 0 is passed to the function.
Hence, the changes to be made is to replace the base case with x <= 0