Answer:
#include<iostream>
using namespace std;
int main(){
char str[20];
int i=0;
std::cout<<"Enter a name:" ;
cin>>str;
cout<<*str;
while(str[i]!='\0'){
if(str[i]==' '){
i++;
cin>>*(str+i);
}
i++;
}
return 0;
}
A) improved problem solving
b) deeper understanding
Logic gates take boolean input(s) and returns boolean output(s).
OR gate:
Two inputs, output is true if at least one input is 1.
AND gate:
Two inputs, output is true if both inputs are 1.
NOT gate:
One input, output is the reversed bit; 0 -> 1, 1 -> 0.
NAND gate:
Essentially a "Not AND" gate. The reverse of the AND gate.
NOR gate:
Essentially a "Not OR" gate. The reverse of the OR gate.
XOR gate:
Similar to an OR gate, outputs 1 if only one input is one.
These can be understood a lot better by looking at their respected truth tables.