Shortest word in a sentence c

I have created the below program to detect the shortest word in a sentence for me. However, the result is not what I expected. I went through the code a few times and I still could not find the problem.

I would be very grateful if someone could lend me some help.

#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>

ssize_t find_short(const char *s);

int main(void)
{
    char s[100] ="lets talk about C the best language";
    printf("%zu", find_short(s));
}

ssize_t find_short(const char *s)
{
    int n = strlen(s);
    int smallest = n;
    int counter = 0;
    for (int i = 0; i <= n; i++)
    {
        if (s[i] == ' ' || s[i] == '')
        {
            if (counter <= smallest)
            {
            smallest = (ssize_t) counter;
            counter = 0;
            }
        }
        else
        counter ++;
    }
    return smallest;
}

Thank you very much.

asked Sep 9, 2020 at 6:57

heihei's user avatar

1

You reset counter only when counter is smallest than smallest. If a new word is shorter than any previous, it will be ignored.

ssize_t find_short(const char *s)
{
    int n = strlen(s);
    int smallest = n;
    int counter = 0;
    for (int i = 0; i <= n; i++)
    {
        if (s[i] == ' ' || s[i] == '')
        {
            if (counter <= smallest)
            {
                smallest = (ssize_t) counter;
                // <-- not here
            }
            counter = 0;  //  < -- here
        }
        else
            counter ++;
    }
    return smallest;
}

answered Sep 9, 2020 at 7:03

Mathieu's user avatar

MathieuMathieu

8,6657 gold badges33 silver badges45 bronze badges

0

counter=0 should be outside the if statement

ssize_t find_short(const char *s)
{
    int n = strlen(s);
    int smallest = n;
    int counter = 0;
    for (int i = 0; i <= n; i++)
    {
        if (s[i] == ' ' || s[i] == '')
        {
            if (counter <= smallest)
            {
            smallest = (ssize_t) counter;

            }
            counter = 0;
        }
        else
        counter ++;
    }
    return smallest;
}

answered Sep 9, 2020 at 7:11

Imran's user avatar

ImranImran

7557 silver badges19 bronze badges

0

This program finds shortest word in a given string or text using C programming language.

C Source Code: Shortest Word


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

int main()
{
 char string[100], shortest[30];
 int count = 0, min,i,j,index=0,length;

 printf("Enter String:n");
 gets(string);
 length = strlen(string);
 index=0;

 /* Initially set some large value to min */
 min = 100; // This is important

 /* Finding length of shortest word and starting index */
 for( i = 0 ; i< length ; i++)
 {
  if(string[i] != ' ')
  {
   count++;
  }
  else
  {
   if(count < min)
   {
    min = count;
    index = i-min;
   }
   count = 0;
  }
 }

 /* Checking if last word is shortest */
 if(count< min)
 {
  min = count;
  index = length-min;
 }

 /* Using length and index copying shortest word */
 j=0;
 for(i=index;i< index+min;i++)
 {
  shortest[j] = string[i];
  j++;
 }

 /* Inserting NULL character to terminate string */
 longest[j] = '';
 printf("Shortest word is: %sn", shortest);
 printf("And its length is %d",min);

 return 0;
}

Shorted Word C Program Output

Enter Sentence:
Tongue tied and twisted just an earth bound misfit I ↲ 
Shortest word is: I
And its length is: 1


Note: ↲ indicates ENTER is pressed.

  1. 01-16-2013


    #1

    tgeandpudding is offline


    Registered User


    help with longest and shortest WORD in c programming

    Please help mea rush program) needed badly
    The user will input a sentence. Your program will determine the longest word/s and the number of characters of the longest word. If the longest or shortest word occurs more than once, it will only output once.

    Example:
    input: life is so beautiful

    Output:
    Longest Word/s: beautiful
    Shortest Word/s: is,so
    Number of Characters: 9

    Input: the quick brown fox jumps over the lazy dog.
    Output:

    Longest Word/s: quick, brown, jumps
    Shortest Word/s: the fox dog
    Number of Characters: 5

    Last edited by tgeandpudding; 01-16-2013 at 07:41 AM.


  2. 01-16-2013


    #2

    c99tutorial is offline


    Registered User


    Unfortunately, there is no built-in function in C standard library which find the longest word given an input sentence. But you should be able to get something working using these standard functions:

    getchar — for reading characters
    isalpha — for testing whether something is a word character
    strcpy — for saving the words into a list
    strlen — for seeing which word is longest and how long it is

    Write out a simple pseudocode first in plain english like
    read a character
    is it a word character?
    if so, blah blah…
    etc.

    Then it reduces to a translation problem. Translate pseudocode to C. That’s what the forum can help you with, not really writing it for you.


  3. 01-16-2013


    #3

    tgeandpudding is offline


    Registered User


    reply

    This program, how to improve this? It have invalid output. The output must be the question above. Sorry for a lot of question. I have only few idea about c programming


  4. 01-16-2013


    #4

    Matticus is offline


    Registered User


    How much effort do you expect the members of this forum to put into helping you, when you show no effort yourself? People will be less inclined to help you if you’re simply copying someone else’s broken code.


  5. 01-16-2013


    #5

    tgeandpudding is offline


    Registered User


    Very sorry for that. I’m just making comparisons to programs of others to my program. Anyway thank you for the responses. If I post my real program can you help me Mr. Matticus?


  6. 01-16-2013


    #6

    tgeandpudding is offline


    Registered User


    My real program

    Very sorry for that. I’m just making comparisons to programs of others to my program. Anyway thank you for the responses. If I post my real program can you help me Mr. Matticus?
    this is the real program that I made.


  7. 01-16-2013


    #7

    tgeandpudding is offline


    Registered User


    Very sorry for that. I’m just making comparisons to programs of others to my program. Anyway thank you for the responses. If I post my real program can you help me Mr. Matticus?
    this is the real program that I made.


  8. 01-16-2013


    #8

    nonpuz is offline


    Ultraviolence Connoisseur


    So even though you copied this code, there is a glaring bug in this code that was not mentioned in the other thread so I will mention it here.

    This

    Code:

    #define LEN 20
    ...
         char word[LEN];
    ...
    ...
    
             while( (ch = getchar()) != 'n')
                    if(i < LEN)
                      word[i++] = ch;
    
             word[i]  = ''; /* OOPS if i == LEN (which is possible due to the above loop) you tromp over memory thats not yours (undefined behavior) */
    ...


  9. 01-16-2013


    #9

    Matticus is offline


    Registered User


    Quote Originally Posted by tgeandpudding
    View Post

    Very sorry for that. I’m just making comparisons to programs of others to my program. Anyway thank you for the responses. If I post my real program can you help me Mr. Matticus?
    this is the real program that I made.

    Of course! That’s why I’m here. Be sure to use code tags when posting your code, as well as any problems you’re having.


  10. 01-16-2013


    #10

    tgeandpudding is offline


    Registered User


    Okay. But what about my code. the attachment above? thanks for the help.. There is a lot of errors making my head aching.

    Last edited by tgeandpudding; 01-16-2013 at 09:08 AM.


  11. 01-16-2013


    #11

    tgeandpudding is offline


    Registered User


    Quote Originally Posted by Matticus
    View Post

    Of course! That’s why I’m here. Be sure to use code tags when posting your code, as well as any problems you’re having.

    I don’t know how to use code tags. I am new here. Very sorry.


  12. 01-16-2013


    #12

    Matticus is offline


    Registered User


    In the future, it would be better to just post your code so it can be referenced easily.

    First of all, proper indentation is very important. Here is your code with better formatting:

    Code:

    #include <stdio.h>
    #include <string.h>
    #include <conio.h>
    
    void main()
    {
        char longestw, shortestw, temp,i;
        int longest = 0, shortest=0;
    
        while(temp=='')
        {
            scanf("%c",&temp);
            if(strlen(temp)>longest)
            {
                longestw=temp;
                longest=strlen(temp);
            }
    
            if(shortest==0)
            {
                shortest= strlen(temp);
                shortestw=temp;
            }
        }  // ???
            else(strlen(temp)<shortest)
            {
                shortest=strlen(temp);
                shortestw=temp;
            }
        }
    
        for(i=0; i<strlen(words);++i)
        {
            printf("%s",words[i]);
            if(i<strlen-1)
            {
                printf("%s,", word);
            }
            else
            {
                printf(".");
            }
        }
    
        printf("the longest word entered was %s with %d characters", longestw, longest);
        printf("the longest word entered was %s with %d characters", shortestw, shortest);
        getch();
        return 0;
    }

    Here’s what I see so far:

    — With better indentation, it’s clear that you have an extra closing curly brace on line 24, which is an error.
    — There’s no reason to use «conio.h» — it is non-standard, and you’re only using it for the «getch()» at the end of the program. This can accomplished easily with standard library functions.
    — «main()» return «int», not «void»
    — You need to use character arrays to store strings. You only have single character variables declared. This is insufficient to hold a string (which is a character array terminated with a null character, »).
    — The variable «temp» is uninitialized, and is used (in the condition of the «while()» loop) before it is ever given a value.
    — You’re only reading a single character with «scanf()». You need to read a string. «scanf()» with «%s» will stop reading at the first whitespace, so this is only good for a single word. «fgets()» is probably better for this project.
    — You’re using variables that are never declared («words[]», «word»).

    It seems clear that this code was written all at once without any intermediate testing (and perhaps with a hefty dose of copying). It is good practice to break you problem down into small steps, and tackle (and test) each one separately. And when you write code, compile often to make sure there are no mistakes along the way. Also, this is worth a read:

    A development process

    Also, a pencil and paper can go a long way in developing logic. Don’t try to do it all in your head — figure it out by hand first, then use that to develop your code.

    I would recommend writing a program to read a string from the user and print it out to the screen. Compile and test. When it’s working, add the next thing bit of code (say, to determine the longest word). Build up the program in steps.

    Last edited by Matticus; 01-16-2013 at 09:35 AM.

    Reason: more info


  13. 01-16-2013


    #13

    Matticus is offline


    Registered User


    Quote Originally Posted by tgeandpudding
    View Post

    I don’t know how to use code tags. I am new here. Very sorry.

    It’s not that hard, read the link.

    [code]
    (paste your code here)
    [/code]


  14. 01-16-2013


    #14

    tgeandpudding is offline


    Registered User


    Quote Originally Posted by Matticus
    View Post

    In the future, it would be better to just post your code so it can be referenced easily.

    First of all, proper indentation is very important. Here is your code with better formatting:

    Code:

    #include <stdio.h>
    #include <string.h>
    #include <conio.h>
    
    void main()
    {
        char longestw, shortestw, temp,i;
        int longest = 0, shortest=0;
    
        while(temp=='')
        {
            scanf("%c",&temp);
            if(strlen(temp)>longest)
            {
                longestw=temp;
                longest=strlen(temp);
            }
    
            if(shortest==0)
            {
                shortest= strlen(temp);
                shortestw=temp;
            }
        }  // ???
            else(strlen(temp)<shortest)
            {
                shortest=strlen(temp);
                shortestw=temp;
            }
        }
    
        for(i=0; i<strlen(words);++i)
        {
            printf("%s",words[i]);
            if(i<strlen-1)
            {
                printf("%s,", word);
            }
            else
            {
                printf(".");
            }
        }
    
        printf("the longest word entered was %s with %d characters", longestw, longest);
        printf("the longest word entered was %s with %d characters", shortestw, shortest);
        getch();
        return 0;
    }

    Here’s what I see so far:

    — With better indentation, it’s clear that you have an extra closing curly brace on line 24, which is an error.
    — There’s no reason to use «conio.h» — it is non-standard, and you’re only using it for the «getch()» at the end of the program. This can accomplished easily with standard library functions.
    — «main()» return «int», not «void»
    — You need to use character arrays to store strings. You only have single character variables declared. This is insufficient to hold a string (which is a character array terminated with a null character, »).
    — The variable «temp» is uninitialized, and is used (in the condition of the «while()» loop) before it is ever given a value.
    — You’re only reading a single character with «scanf()». You need to read a string. «scanf()» with «%s» will stop reading at the first whitespace, so this is only good for a single word. «fgets()» is probably better for this project.
    — You’re using variables that are never declared («words[]», «word»).

    It seems clear that this code was written all at once without any intermediate testing (and perhaps with a hefty dose of copying). It is good practice to break you problem down into small steps, and tackle (and test) each one separately. And when you write code, compile often to make sure there are no mistakes along the way. Also, this is worth a read:

    A development process

    I would recommend writing a program to read a string from the user and print it out to the screen. Compile and test. When it’s working, add the next thing bit of code (say, to determine the longest word). Build up the program in steps.

    A big thank you for your advice.


  15. 01-16-2013


    #15

    tgeandpudding is offline


    Registered User


    Quote Originally Posted by Matticus
    View Post

    In the future, it would be better to just post your code so it can be referenced easily.

    First of all, proper indentation is very important. Here is your code with better formatting:

    Code:

    #include <stdio.h>
    #include <string.h>
    #include <conio.h>
    
    void main()
    {
        char longestw, shortestw, temp,i;
        int longest = 0, shortest=0;
    
        while(temp=='')
        {
            scanf("%c",&temp);
            if(strlen(temp)>longest)
            {
                longestw=temp;
                longest=strlen(temp);
            }
    
            if(shortest==0)
            {
                shortest= strlen(temp);
                shortestw=temp;
            }
        }  // ???
            else(strlen(temp)<shortest)
            {
                shortest=strlen(temp);
                shortestw=temp;
            }
        }
    
        for(i=0; i<strlen(words);++i)
        {
            printf("%s",words[i]);
            if(i<strlen-1)
            {
                printf("%s,", word);
            }
            else
            {
                printf(".");
            }
        }
    
        printf("the longest word entered was %s with %d characters", longestw, longest);
        printf("the longest word entered was %s with %d characters", shortestw, shortest);
        getch();
        return 0;
    }

    Here’s what I see so far:

    — With better indentation, it’s clear that you have an extra closing curly brace on line 24, which is an error.
    — There’s no reason to use «conio.h» — it is non-standard, and you’re only using it for the «getch()» at the end of the program. This can accomplished easily with standard library functions.
    — «main()» return «int», not «void»
    — You need to use character arrays to store strings. You only have single character variables declared. This is insufficient to hold a string (which is a character array terminated with a null character, »).
    — The variable «temp» is uninitialized, and is used (in the condition of the «while()» loop) before it is ever given a value.
    — You’re only reading a single character with «scanf()». You need to read a string. «scanf()» with «%s» will stop reading at the first whitespace, so this is only good for a single word. «fgets()» is probably better for this project.
    — You’re using variables that are never declared («words[]», «word»).

    It seems clear that this code was written all at once without any intermediate testing (and perhaps with a hefty dose of copying). It is good practice to break you problem down into small steps, and tackle (and test) each one separately. And when you write code, compile often to make sure there are no mistakes along the way. Also, this is worth a read:

    A development process

    Also, a pencil and paper can go a long way in developing logic. Don’t try to do it all in your head — figure it out by hand first, then use that to develop your code.

    I would recommend writing a program to read a string from the user and print it out to the screen. Compile and test. When it’s working, add the next thing bit of code (say, to determine the longest word). Build up the program in steps.

    Again thank you. I learn a lot of things today. Its already 11:00 am, I have classes tomorrow and the deadline of this code is tomorrow. Better luck next time. Next time I will do your advice so that I can make my code correctly.


Improve Article

Save Article

Like Article

  • Read
  • Discuss
  • Improve Article

    Save Article

    Like Article

    Given a string, find the minimum and the maximum length words in it. 

    Examples: 

    Input : "This is a test string"
    Output : Minimum length word: a
             Maximum length word: string
    
    Input : "GeeksforGeeks A computer Science portal for Geeks"
    Output : Minimum length word: A
             Maximum length word: GeeksforGeeks

    Method 1: The idea is to keep a starting index si and an ending index ei

    • si points to the starting of a new word and we traverse the string using ei.
    • Whenever a space or ‘’ character is encountered,we compute the length of the current word using (ei – si) and compare it with the minimum and the maximum length so far. 
      • If it is less, update the min_length and the min_start_index( which points to the starting of the minimum length word).
      • If it is greater, update the max_length and the max_start_index( which points to the starting of the maximum length word).
    • Finally, update minWord and maxWord which are output strings that have been sent by reference with the substrings starting at min_start_index and max_start_index of length min_length and max_length respectively.

    Below is the implementation of the above approach:

    C++

    #include<iostream>

    #include<cstring>

    using namespace std;

    void minMaxLengthWords(string input, string &minWord, string &maxWord)

    {

        int len = input.length();

        int si = 0, ei = 0;

        int min_length = len, min_start_index = 0, max_length = 0, max_start_index = 0;

        while (ei <= len)

        {

            if (ei < len && input[ei] != ' ')

                ei++;

            else

            {

                int curr_length = ei - si;

                if (curr_length < min_length)

                {

                    min_length = curr_length;

                    min_start_index = si;

                }

                if (curr_length > max_length)

                {

                    max_length = curr_length;

                    max_start_index = si;

                }

                ei++;

                si = ei;

            }

        }

        minWord = input.substr(min_start_index, min_length);

        maxWord = input.substr(max_start_index, max_length);

    }

    int main()

    {

        string a = "GeeksforGeeks A Computer Science portal for Geeks";

        string minWord, maxWord;

        minMaxLengthWords(a, minWord, maxWord);

        cout << "Minimum length word: "

            << minWord << endl

            << "Maximum length word: "

            << maxWord << endl;

    }

    Java

    import java.io.*;

    class GFG

    {

        static String minWord = "", maxWord = "";

        static void minMaxLengthWords(String input)

        {

              input=input.trim();

            int len = input.length();

            int si = 0, ei = 0;

            int min_length = len, min_start_index = 0,

                  max_length = 0, max_start_index = 0;

            while (ei <= len)

            {

                if (ei < len && input.charAt(ei) != ' ')

                {

                    ei++;

                }

                else

                {

                    int curr_length = ei - si;

                    if (curr_length < min_length)

                    {

                        min_length = curr_length;

                        min_start_index = si;

                    }

                    if (curr_length > max_length)

                    {

                        max_length = curr_length;

                        max_start_index = si;

                    }

                    ei++;

                    si = ei;

                }

            }

            minWord = input.substring(min_start_index, min_start_index + min_length);

            maxWord = input.substring(max_start_index, max_start_index+max_length);

        }

        public static void main(String[] args)

        {

            String a = "GeeksforGeeks A Computer Science portal for Geeks";

            minMaxLengthWords(a);

            System.out.print("Minimum length word: "

                    + minWord

                    + "nMaximum length word: "

                    + maxWord);

        }

    }

    Python 3

    def minMaxLengthWords(inp):

        length = len(inp)

        si = ei = 0

        min_length = length

        min_start_index = max_length = max_start_index = 0

        while ei <= length:

            if (ei < length) and (inp[ei] != " "):

                ei += 1

            else:

                curr_length = ei - si

                if curr_length < min_length:

                    min_length = curr_length

                    min_start_index = si

                if curr_length > max_length:

                    max_length = curr_length

                    max_start_index = si

                ei += 1

                si = ei

        minWord = inp[min_start_index :

                      min_start_index + min_length]

        maxWord = inp[max_start_index : max_length]

        print("Minimum length word: ", minWord)

        print ("Maximum length word: ", maxWord)

    a = "GeeksforGeeks A Computer Science portal for Geeks"

    minMaxLengthWords(a)

    C#

    using System;

    class GFG

    {

        static String minWord = "", maxWord = "";

        static void minMaxLengthWords(String input)

        {

            int len = input.Length;

            int si = 0, ei = 0;

            int min_length = len, min_start_index = 0,

                max_length = 0, max_start_index = 0;

            while (ei <= len)

            {

                if (ei < len && input[ei] != ' ')

                {

                    ei++;

                }

                else

                {

                    int curr_length = ei - si;

                    if (curr_length < min_length)

                    {

                        min_length = curr_length;

                        min_start_index = si;

                    }

                    if (curr_length > max_length)

                    {

                        max_length = curr_length;

                        max_start_index = si;

                    }

                    ei++;

                    si = ei;

                }

            }

            minWord = input.Substring(min_start_index, min_length);

            maxWord = input.Substring(max_start_index, max_length);

        }

        public static void Main(String[] args)

        {

            String a = "GeeksforGeeks A Computer Science portal for Geeks";

            minMaxLengthWords(a);

            Console.Write("Minimum length word: "

                    + minWord

                    + "nMaximum length word: "

                    + maxWord);

        }

    }

    Javascript

    <script>

    let minWord = "";

    let maxWord = "";

    function minMaxLengthWords(input)

    {

        let len = input.length;

        let si = 0, ei = 0;

        let min_length = len;

        let min_start_index = 0;

        let max_length = 0;

        let max_start_index = 0;

        while (ei <= len)

        {

            if (ei < len && input[ei] != ' ')

            {

                ei++;

            }

            else

            {

                let curr_length = ei - si;

                if (curr_length < min_length)

                {

                    min_length = curr_length;

                    min_start_index = si;

                }

                if (curr_length > max_length)

                {

                    max_length = curr_length;

                    max_start_index = si;

                }

                ei++;

                si = ei;

            }

        }

        minWord =

        input.substring(min_start_index,min_start_index + min_length);

        maxWord =

        input.substring(max_start_index, max_length);

    }

    let a = "GeeksforGeeks A Computer Science portal for Geeks";

    minMaxLengthWords(a);

    document.write("Minimum length word: "

            + minWord+"<br>"

            + "Maximum length word:  "

            + maxWord);

    </script>

    Output

    Minimum length word: A
    Maximum length word: GeeksforGeeks

    Time Complexity: O(n), where n is the length of string.
    Auxiliary Space: O(n), where n is the length of string. This is because when string is passed in the function it creates a copy of itself in stack.

    Like Article

    Save Article

    Sentences can be made up of many words and phrases. It’s also possible to make a sentence with only one word. Even better than that, it’s possible to use only a handful of letters to create the shortest complete sentences. This article will explore a selection of them.

    Shortest Complete Sentences in English

    The preferred shortest sentences include “I,” “no,” and “go!” There are so many great options out there, but these are amongst the shortest ones that you’re most likely going to come across. The options are endless once you understand the fundamentals.

    I.

    Officially, “I” is the shortest complete sentence. You can use it as a subjective response when someone asks a question like, “who did it?” Replying with “I” is a short form of saying “it was I.”

    • Who is there?
    • I.
    • Who did it?
    • I.

    No.

    If you want to reject the previous statement or question, “No” is a great two-word sentence. It’s simple and efficient.

    • Do you want to go with me?
    • No.
    • Will you be there?
    • No.

    Go!

    “Go” is the first verb form you can use to create a simple sentence. The subject is implied when “go” is used like this (i.e. it implies “you go”). However, “go” is one of the only two-letter verbs that this works for.

    • What should I do now?
    • Go! Don’t wait around.
    • Are you ready to race?
    • Go!

    Oh.

    “Oh” is an exclamation. Most people use it when they don’t know what else to say. It’s a simple two-letter phrase that shows you are surprised.

    • I’m not going to be there with you.
    • Oh.
    • I’m sorry.
    • Oh.

    Hm.

    “Hm” is a thoughtful sentence. You should use these two letters when you are thinking about an answer that might be suitable to the question.

    • You’re going to think about this, right?
    • Hm.
    • I don’t know what to do. Do you have any ideas?
    • Hm.

    Hi.

    “Hi” is a very common two-letter sentence. It is a greeting, and native speakers use it to informally say “hello” to their peers.

    • Hi!
    • Hi! How are you?
    • Hello, there!
    • Hi.

    Me.

    “Me” is similar to using “I.” Technically, it’s not correct to use because it is the object form, but the idea is to replace “I” with “me” when answering a question. For example, “who did it?” can be answered with “me” (implying “it was me”).

    • Who’s there?
    • Me.
    • Who else can be on this team?
    • Me.

    You.

    “You” moves up to three letters. We’ve run out of two-letter sentences, but there are so many three-letter ones. “You” is another subjective pronoun that can work to answer specific questions like “who did it?”

    • Who is going to get this done?
    • You.
    • Who will be there for you?
    • You.

    Yes.

    “Yes” is the opposite of “no.” It’s an affirmative response that agrees with a statement or shows that you are willing to do something.

    • Will you be there?
    • Yes.
    • Can you come with me?
    • Yes.

    Why?

    “Why?” is a good example of a complete sentence that becomes a question. You should use this when you want to know what made someone do something.

    • I did that.
    • Why?
    • I thought you’d like it.
    • Why?

    Him.

    “Him” allows you to use an objective pronoun to highlight who might have done something. “Him” refers to a man, allowing you to point him out if he relates to the question.

    • Do you know who did it?
    • Him.
    • Which one of these people was there?
    • Him.

    Her.

    “Her” is another objective pronoun that works. Like “me,” it’s probably better to use “she” as the subject, but informal English allows you to use object pronouns as long as they’re in one-word sentences.

    • Which one of them was it?
    • Her.
    • Who did it?
    • Her.

    Hey.

    “Hey” is another example of an informal greeting that replaces “hello.” It allows you to greet your friends and peers. It’s three letters long, which is still a remarkably short sentence.

    • Hi!
    • Hey.
    • Hello, friend.
    • Hey.

    I Am.

    “I am” is the first example of two words making up a short sentence. While two words are used, only three letters are present. Here, you can include the subject (only “I” will work to keep it three letters) and the verb (as long as it’s two letters long).

    • Are you going to be there later today?
    • I am.
    • Are you the one in charge of these findings?
    • I am.

    I Do.

    “I do” is another great example of two words making up a short completed sentence. You can use “do” to show that you are going to do something. Again, “I” has to be used as it’s only one letter. The verb can only be two letters to keep the sentence short.

    • Do you take this man to be your husband?
    • I do.
    • Do you have what it takes?
    • I do.

    Sit.

    “Sit” is a three-letter verb form that works as a sentence. Just like “go,” the subject is implied through the context. It can mean something like “you sit” or “he should sit,” depending on the context.

    • What should I do now?
    • Sit.
    • Do you want me to hang around?
    • Sit.

    Run.

    “Run” is another good verb choice made of only three letters. There are plenty of others out there, but we won’t overwhelm you. All verbs work in the same way here, where the subject is always implied. They work as imperative forms (orders or commands).

    • What do you want me to do now?
    • Run!
    • What is that noise?
    • Run!

    One.

    Numbers are also suitable as short sentences when they are spelled out. One of the shortest numbers is “one,” which is only made up of three letters.

    • How many of you are going?
    • One.
    • How many years have you done this?
    • One.

    Two.

    “Two” is twice as much as one, but it is made up of the same number of letters. You can use it to answer questions that ask for a quantity.

    • How many of them are left?
    • Two.
    • How many people can this accommodate?
    • Two.

    Ten.

    “Ten” is the largest number you can include in a three-letter sentence. It’s possible to use this in the same way as the other numbers, where “ten” is the quantity.

    • How many can come today?
    • Ten.
    • How many are in stock?
    • Ten.

    martin lassen dam grammarhow

    Martin holds a Master’s degree in Finance and International Business. He has six years of experience in professional communication with clients, executives, and colleagues. Furthermore, he has teaching experience from Aarhus University. Martin has been featured as an expert in communication and teaching on Forbes and Shopify. Read more about Martin here.

    Like this post? Please share to your friends:
  • Shortest word codewars js
  • Shorter word for competition
  • Shorter version of a word
  • Shortening as a type of word formation
  • Shortened word for will not