Wrote the following code fragment and then I was set upon by
Solution
6)
char str[16];
gets(\"%s\");
Here when we are using gets we no need to use % to read the value entered by the user.The reading with \"gets\" is simple when compared with scanf().here simply we can write gets(str); to read the string entered by the user.This will read the string until the newline character encounters.
gets(str);
_________________________________
7)
If we pass the values as arguments to the function while calling then that function this is called pass - by value.
If we are passing the address of that variables as arguments while calling the function ,it is called as pass by reference.
During pass by value the function uses those arguments and performed required calculations .But in the main method the variables values will not get changed .remains same.
But if we use pass by reference if we performs any operations on those values which was refered by the reference.Then that changes will get effected.when we want the changed values after performing the operations on the values then we have to use pass by reference.
____________________________________
