Skip to main content
    #include<stdio.h>
#include<cs50.h>

int main(void)
 
{
    int n,r,a,s;
    
    do { 
        printf("the pyramids height?\n");
        n = get_int();}
    } while(n<=0||n>=23);
    
    for(r=0;r==n+1;r++)
    {
        for(s=n-2;s==0;s--)
        {
            printf(" ");
        }
        
        for(a=;a==n+1;a++)
        {
            printf("#");
        }
    }
    {
        printf("\n");
    }
}

This is the code I wrote. I dont get the logical error I made, i have been doing it for a week or more. can someone help me?

    #include<stdio.h>
#include<cs50.h>

int main(void)
 
{int n,r,a,s;
do{ printf("the pyramids height?\n");
     n = get_int();}
while(n<=0||n>=23);
  for(r=0;r==n+1;r++)
 {for(s=n-2;s==0;s--)
 {printf(" ");}
 for(a=;a==n+1;a++)
 {printf("#");}}
 {printf("\n");}
}

This is the code I wrote. I dont get the logical error I made, i have been doing it for a week or more. can someone help me?

#include<stdio.h>
#include<cs50.h>

int main(void)
{
    int n,r,a,s;
    
    do { 
        printf("the pyramids height?\n");
        n = get_int();
    } while(n<=0||n>=23);
    
    for(r=0;r==n+1;r++)
    {
        for(s=n-2;s==0;s--)
        {
            printf(" ");
        }
        
        for(a=;a==n+1;a++)
        {
            printf("#");
        }
    }
    {
        printf("\n");
    }
}

This is the code I wrote. I dont get the logical error I made, i have been doing it for a week or more. can someone help me?

Source Link

Stuck in pset1 mario.c

    #include<stdio.h>
#include<cs50.h>

int main(void)

{int n,r,a,s;
do{ printf("the pyramids height?\n");
     n = get_int();}
while(n<=0||n>=23);
  for(r=0;r==n+1;r++)
 {for(s=n-2;s==0;s--)
 {printf(" ");}
 for(a=;a==n+1;a++)
 {printf("#");}}
 {printf("\n");}
}

This is the code I wrote. I dont get the logical error I made, i have been doing it for a week or more. can someone help me?