Please Help me to get the solution of this pattersn as i am weak in loops that is why i am asking and i have my exam tommorrow .

Recommended Answers

All 6 Replies

You're supposed to put some effort when you want help. People here are asked not to help when there is no effort shown in the question.
Read this also.

I know that and agree with you but i have other things to complete for exam and i need your help as soon as possible ... Only tell me the For Loop Execuetion and rest i will do myself ..

commented: Your agreement matters very litte. Show some effort or stop wasting everyone's time. This isn't a homework completion service. -3
int i;
    for (i = 0; i < 10; i++)
    {
       "enter your code here"

this will do a 10 count loop but i dont know how long you want the loop hope it helps

i'll give you a solution for the second one.

 int i,j,n=5;

for(i=0;i<n;i++)
{
    for(j=0;j<n;j++)
    {
        printf("%d ",j+1);
    }
    n--;
    printf("\n");
    for(j=0;j<i+1;j++)
       printf("  ");
}

first for loop return 5 times because we define n(number that you wanna print) as 5.That means we gonna print 5 lines of numbers.
second for loop print the number on each line.
third for loop give us the correct shape.on every line it prints some spaces for the correct shape.
we also decrement n by one.Think about first question and try to make sth.

you ask for a basic for loop so i wrote one and then you give me bad mark for it
what you wanted was someone to complete your question ?
thats pointless?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.