Pattern Series | Interview Code

#include<iostream>

using namespace std;

int main()
{
    int no;
    cin>>no;
    for(auto i=0; i<no; i++)
    {
        for(auto j=i;j<no;j++)
        {
            cout<<"*";
        }
        for(auto j=0;j<i;j++)
        {
            cout<<' ';
        }
        for(auto j=0;j<i;j++)
        {
            cout<<' ';
        }
        for(auto j=i;j<no;j++)
        {
            cout<<"*";
        }
        cout<<"\n";
    }
    return 0;
}
Output will appear here
Featured

Pattern series | Interview Code

#include<iostream>

using namespace std;

int main()
{
    int no;
    cin>>no;
    for(auto i=0; i<no; i++)
    {
        for(auto j=0;j<i;j++)
        {
            cout<<"*";
        }
        for(auto j=i;j<no-1;j++)
        {
            cout<<' ';
        }
        for(auto j=i;j<no-1;j++)
        {
            cout<<' ';
        }
        for(auto j=0;j<i;j++)
        {
            cout<<"*";
        }
        cout<<"\n";
    }
    return 0;
}
Output will appear here..
Featured

Pattern Series | Interview Code

#include<iostream>
using namespace std;

int main()
{
    int no;
    cin>>no;
    for(auto i = 0; i<no; i++)
    {
        for(auto j = 0; j<i; j++)
        {
            cout<<" ";
        }
        for(auto j = i; j<no; j++)
        {
            cout<<"*";
        }
        cout<<"\n";
    }
    for(auto i = 0; i<no; i++)
    {
        for(auto j = i; j<no-1; j++)
        {
            cout<<" ";
        }
        for(auto j = 0; j<=i; j++)
        {
            cout<<"*";
        }
        cout<<"\n";
    }
    return 0;
}
Output will appear here

Factorial of Given Number | simple program | in C++ language | mostly asked in Interview | simple logic

//factorial of an given number
//by:- aniketkoli183@gamil.com
//visit here :- https://jerryindia.home.blog/

#include<iostream>
using namespace std;

int fact(int size)
{
	int temp=1;
	for(int i=1;i<=size;i++)
	{
		temp*=i;
		
	}
	cout<<temp;
}
int main()
{
	int size;
	cout<<"Enter number to calculate factorail := ";
	cin>>size;
	fact(size);
	return 0;
}
output of program