Skip to main content
deleted 2 characters in body
Source Link
user7194
user7194

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void)
{
    int s = 0; // Height
    int t = 0; // Line
    int u = 0; // Column

    do
    {
        // Gathers string.
        printf("Please provide the height of the pyramid: ");
        stringint s = GetStringGetInt(void);
    }
    while (s < 1 || s > 23);

    // Selects a line.
    for (int t = 1; t <= s; t++)
    {
        // Selects a column.    
        for (int u = 1; u <= s; u++) 
        {
        // Prints character.
        if (u >= s + 1 - t)
        {
            printf("#");
        }
        else
        {
            printf(" ");
        }
        }
    }
    // Prints next line.
    printf("\n");
}

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void)
{
    int s = 0; // Height
    int t = 0; // Line
    int u = 0; // Column

    do
    {
        // Gathers string.
        printf("Please provide the height of the pyramid: ");
        string s = GetString();
    }
    while (s < 1 || s > 23);

    // Selects a line.
    for (int t = 1; t <= s; t++)
    {
        // Selects a column.    
        for (int u = 1; u <= s; u++) 
        {
        // Prints character.
        if (u >= s + 1 - t)
        {
            printf("#");
        }
        else
        {
            printf(" ");
        }
        }
    }
    // Prints next line.
    printf("\n");
}

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void)
{
    int s = 0; // Height
    int t = 0; // Line
    int u = 0; // Column

    do
    {
        // Gathers string.
        printf("Please provide the height of the pyramid: ");
        int s = GetInt(void);
    }
    while (s < 1 || s > 23);

    // Selects a line.
    for (int t = 1; t <= s; t++)
    {
        // Selects a column.    
        for (int u = 1; u <= s; u++) 
        {
        // Prints character.
        if (u >= s + 1 - t)
        {
            printf("#");
        }
        else
        {
            printf(" ");
        }
        }
    }
    // Prints next line.
    printf("\n");
}
added 320 characters in body
Source Link
user7194
user7194

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

During Problem Set i came across the error Expected Expression on the statement
"string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

    int main(void)
    {
        int s = 0; // Height
        int t = 0; // Line
        int u = 0; // Column

        do
        {
            // Gathers string.
            printf("Please provide the height of the pyramid: ");
            string s = GetString();
        }
        while (s < 1 || s > 23);

        // Selects a line.
        for (int t = 1; t <= s; t++)
        {
            // Selects a column.    
            for (int u = 1; u <= s; u++) 
            {
            // Prints character.
            if (u >= s + 1 - t)
            {
                printf("#");
            }
            else
            {
                printf(" ");
            }
            }
        }
        // Prints next line.
        printf("\n");
    }
During Problem Set i came across the error Expected Expression on the statement
"string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

    int main(void)
    {
        int s = 0; // Height
        int t = 0; // Line
        int u = 0; // Column

        do
        {
            // Gathers string.
            printf("Please provide the height of the pyramid: ");
            string s = GetString();
        }
        while (s < 1 || s > 23);

        // Selects a line.
        for (int t = 1; t <= s; t++)
        {
            // Selects a column.    
            for (int u = 1; u <= s; u++) 
            {
            // Prints character.
            if (u >= s + 1 - t)
            {
                printf("#");
            }
            else
            {
                printf(" ");
            }
            }
        }
        // Prints next line.
        printf("\n");
    }

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void)
{
    int s = 0; // Height
    int t = 0; // Line
    int u = 0; // Column

    do
    {
        // Gathers string.
        printf("Please provide the height of the pyramid: ");
        string s = GetString();
    }
    while (s < 1 || s > 23);

    // Selects a line.
    for (int t = 1; t <= s; t++)
    {
        // Selects a column.    
        for (int u = 1; u <= s; u++) 
        {
        // Prints character.
        if (u >= s + 1 - t)
        {
            printf("#");
        }
        else
        {
            printf(" ");
        }
        }
    }
    // Prints next line.
    printf("\n");
}
added 320 characters in body
Source Link
user7194
user7194

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void) { int s = 0; // Height int t = 0; // Line int u = 0; // Column

During Problem Set i came across the error Expected Expression on the statement
"string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

    int main(void)
    {
        int s = 0; // Height
        int t = 0; // Line
        int u = 0; // Column

        do
        {
            // Gathers string.
            printf("Please provide the height of the pyramid: ");
            string s = GetString();
        }
        while (s < 1 || s > 23);

        // Selects a line.
        for (int t = 1; t <= s; t++)
        {
            // Selects a column.    
            for (int u = 1; u <= s; u++) 
            {
            // Prints character.
            if (u >= s + 1 - t)
            {
                printf("#");
            }
            else
            {
                printf(" ");
            }
            }
        }
        // Prints next line.
        printf("\n");
    }

}

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

int main(void) { int s = 0; // Height int t = 0; // Line int u = 0; // Column

do
{
    // Gathers string.
    printf("Please provide the height of the pyramid: ");
    string s = GetString();
}
while (s < 1 || s > 23);

// Selects a line.
for (int t = 1; t <= s; t++)
{
    // Selects a column.    
    for (int u = 1; u <= s; u++) 
    {
    // Prints character.
    if (u >= s + 1 - t)
    {
        printf("#");
    }
    else
    {
        printf(" ");
    }
    }
}
// Prints next line.
printf("\n");

}

During Problem Set i came across the error Expected Expression on the statement
"string s = GetString();" Suggestions would be appreciated. The code is provided below.

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

    int main(void)
    {
        int s = 0; // Height
        int t = 0; // Line
        int u = 0; // Column

        do
        {
            // Gathers string.
            printf("Please provide the height of the pyramid: ");
            string s = GetString();
        }
        while (s < 1 || s > 23);

        // Selects a line.
        for (int t = 1; t <= s; t++)
        {
            // Selects a column.    
            for (int u = 1; u <= s; u++) 
            {
            // Prints character.
            if (u >= s + 1 - t)
            {
                printf("#");
            }
            else
            {
                printf(" ");
            }
            }
        }
        // Prints next line.
        printf("\n");
    }
Source Link
user7194
user7194
Loading