Write C++ program forgetting the following output.
1
1 2
1 2 3
1 2 3 4
OR
Consider the following C++ program and answer the following questions.
#include<iostream.h>
int main()
{
int a, p = 1;
for(a=1;a<=5;a+=2)
p = p × a;
cout<<p;
}
(a) Predict the output of the above code.
(b) Rewrite the above program using while loop