Here is a short program that illustrates how local variables can be declared anywhere within a block:
int main()
{
int i;
cout<<"inter the number:";
cin>>i;
int j,fact=1;
for(j=i;j>=1;j--)
fact=fact*j;
cout<<"factorial is"<<fact;
return 0;
}
Welcome @blacksteemit
You may like this nice Card. Use it in any way you want: It is a completly free gift for you :)
PS: Some clever Steemians print it for takeaway. The QR-Code leads directly to your blog.
i will try it..
Howdy howdy
![](https://steemitimages.com/0x0/https://media.giphy.com/media/xUPGcigl4eOfc6hA5y/giphy.gif)
Hey , how are you ?
welcome to steemit @blacksteemit
following you now. :D
follow me back pls.