Answer:
void main(){
string name;
printf("Enter Name\n");
stdin("%s",&name);
Printf("\nGreetings %s",name);
}
Explanation:
Here scanf is represented by stdin and we are using that scanner object to read the string value from user.The value which we read are printed in a new line using printf .The format specifier %s in printf is replaced by name variable
Answer:
While loops are typically used when you don’t know how many times the loop needs to repeat. The body of the loop will repeat while the condition is true. The logical expression will be evaluated just before the body of the loop is repeated.
Let’s say that we want to find the square root of a number. For some square roots, you’re never going to be exact. Let’s say that we want to find a square root that, when multiplied by itself, is within 0.01 of the square we want. How do we do it? There’s a really old process that we can apply here.
Start by guessing 2.
Compute the guess squared.
Is the guess squared close to the target number? If it’s within 0.01, we’re done. We’ll take the absolute value of the difference, in case we overshoot. (In Python, abs is the absolute value function.)
If it’s not close enough, we divide the target number by our guess, then average that value with our guess.
That’s our new guess. Square it, and go back to Step #3.
Explanation:
Answer: what is the question
Explanation: