0

hi i need help in making Readability. i get an error when i put in make readability. this the error i get.

$ make readability
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow    readability.c  -lcrypt -lcs50 -lm -o readability
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
<builtin>: recipe for target 'readability' failed
make: *** [readability] Error 1

AND THIS IS MY CODE.

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

int main(void)
{

    string text = get_string("Text: ");
    float letters = 0, words = 1, sentences = 0;

    int n = strlen(text);

    for (int i = 0; i < n; i++)
    {
        if (isalpha(text[i]))
        {
            letters++;
        }
        if (isspace(text[i]))
        {
            words++;
        }
        if (text[i] == '.' || text[i] == '?' || text[i] == '!')
        {
            sentences++;
        }

    float l = 100 / words * letters;
    float s = 100/ words * sentences;

    float index = (0.0588 * l) - (0.296 * s) - 15.8;

    int indexr = (round(index));

    if (indexr >= 1 && indexr < 16)
    {
        printf("Grade %i\n", indexr);
    }
    if (indexr < 1)
    {
        printf("Before Grade 1\n");
    }
    if (indexr >= 16)
    {
        printf("Grade 16+\n");
    }
0

1 Answer 1

0

You have to add } at the end, and in the middle before float l = 100 / words * letters; to close out the for loop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .