Here is a short program that illustrates how local variables can be declared anywhere within a block:

in life •  7 years ago 

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;

}

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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.


Made with Love 💋

i will try it..

Howdy howdy

Hey , how are you ?
welcome to steemit @blacksteemit
following you now. :D
follow me back pls.