IDNLearn.com provides a collaborative environment for finding and sharing answers. Get accurate and detailed answers to your questions from our dedicated community members who are always ready to help.

Write a program named Twitter that accepts a user’s message and determines whether it is short enough for a social networking service that does not accept messages of more than 140 characters.

If the message is more than 140 characters, output The message is too long. Otherwise output The message is okay.


Sagot :

Explanation:

It's a very easy one, Liev:

using System;

class Twitter

{

static void Main()

{

Console.WriteLine("Enter your message");

Console.WriteLine();

string message = Console.ReadLine();

Console.WriteLine();

if (message.Length <= 140)

{

Console.WriteLine("Yes, it's short enough for Twitter");

}

else

{

Console.WriteLine("Sorry, it's too long for Twitter");

}

Console.ReadKey();

}

}