actually main function is a user defined function for the C
compiler developer.... but it is a built in or predefined
function according to the users using that compiler.... why
it is called as a predefined function because , the
prototype has already been defined in the compiler itself
we the users can't change the meaning of that unless or
until we write our own compiler , we can change the meaning
for the main() , we don't know what is the prototype or
where the function has been called and wht excatly the
return value of it... it is built in and abstracted from the
user which is called abstraction in c++.........
the definition of main is given by the user so it is called
user define function..
the prototype is define by the compiler so it is called
this function is dependent on both user and compiler for
the execution of the program.so it is not only user define
so we can say it is a special function called by operating
system to execute the program.
Main() is a predefined
returning val -all these
parameters only kown
to compile,not to
user.but we can use it
as user defined by
specifying our own
main() function is niether predefined nor user defined function. Because if it is predefined, when program is written in main() function then given their own logic then how it is predefined. Another one if it is user defined, then we can write the any function name on the place of main(). So main() is niether a predefined nor user defined function.
Given a number N, product(N) is the product of the digits of
N. We can then form a sequence N, product(N),
product(product(N))… For example, using 99, we get the
sequence 99, 99 = 81, 81 = 8.
A single integer N
A single integer which is the number of steps after which a
single digit number occurs in the sequence.
Sample Test Cases:
Step - 1 : 9 * 9 = 81
Step - 2 : 8 * 1 = 8
There are 2 steps to get to this single digit number.
what does the following code do?
fn(int n,int p,int r)
static int a=p;
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year