whats wrong with my code? this is the part that doest work
float L = (letters / words) * 100; and float S = (sentences / words) * 100;
when I plug in letters, words, and sentences into the formula it gives the wrong answer.
#include <stdio.h>
#include <string.h>
#include <cs50.h>
#include <ctype.h>
#include <math.h>
int main(void)
{
char ch[500];
int i;
int ii;
int iii;
int LettersWspace = 0;
int letters = 0;
int words = 1;
int sentences = 0;
int index;
string text = get_string("Enter Text: ");
for(i = 0; text[i] != '\0'; i++)
{
LettersWspace++;
}
for( i = 0; i < LettersWspace; i++)
{
if (text[i] == 32)
letters++;
}
letters = LettersWspace - letters;
ii = 0;
{
if (text[ii] == ' ')
{
words++;
}
ii++;
}
while (ii <= text[ii]);
iii = 0;
do
{
if (text[iii] == '?' || text[iii] == '!' || text[iii] == '.')
{
sentences++;
}
iii++;
}
while (iii <= text[iii]);
float L = (letters / words) * 100;
float S = (sentences / words) * 100;
return (index = 0.0588 * L - 0.296 * S - 15.8);
printf("%i\n", (int) sentences);
return 0;
}