Counting number of words in a string - c# program, DOT NET Programming

Assignment Help:

Counting Number of Words in a String - C# Program

Anyone can suggest me the output of the following program.

using System;  

class CountWords

{

public static void Main()

{

string s = ""; // Declare 's' of string type  

Console.Write("Enter the string : ");    

S = Console.ReadLine(); // Read string from the console & save in 's'    

string [] words = s.Split(null);

// 'words' is an array of string type

// string 's' will split when a space (null) is encountered

// This will be saved into array words     

int i = words.Length; // Just count the lenght of array 'words'  

Console.WriteLine("The total number of words in the entered string : "+i);    

Console.ReadLine();

}

}


Related Discussions:- Counting number of words in a string - c# program

Problems occur while implement locking in sql server, What are the problems...

What are the problems that can occur if you do not implement locking properly in SQL SERVER? The problems that occur if you do not implement locking properly in SQL SERVER is a

Content page creation, NopCommerce v3.10 - Content Page Creation, Product I...

NopCommerce v3.10 - Content Page Creation, Product Import and Site Customization Project Description: I have an existing website with about 800 products and we could like to

Need integration with tally erp 9, Project Description: I need a simple ...

Project Description: I need a simple app developed using C# or PHP which will talk to Tally ERP 9 using XML over HTTP. Only those who are well versed with Tally ERP 9 and its

Create an account management application, In this task, you are required to...

In this task, you are required to create an Account Management application with Web Form. Your Account Management application must have the following pages: 1.  Create an accoun

I need a sharepoint developer tutor, Project Description: I need a Share...

Project Description: I need a SharePoint Developer tutor to teach me the development of SharePoint from scratch. We will be communicating through TeamViewer and Skype. I have ac

I need cloudflare api interface to c#, I need CloudFlare API interface to C...

I need CloudFlare API interface to C# Project Description: We require a small piece of C# .NET code, integrated in an object, that will interface with CloudFlare's API and ge

What are methods, What are methods? Methods are the building blocks of ...

What are methods? Methods are the building blocks of a class, in which they are linked together to share and process data to produce the result. In other words, a method is a b

Events in dot net pogramming, What are events? As compared to the deleg...

What are events? As compared to the delegates events works with source and listener methodology. So the listeners who are interested in receiving few events they subscribe to t

Briefly explain how server form post-back works, Briefly explain how server...

Briefly explain how server form post-back works ?  Post Back: The process in which a Web page sends data back to the similar page on the server. View State : View State i

Custom login page for sharepoint 2013 with active directory, Custom Login P...

Custom Login Page for SharePoint 2013 with Active Directory Project Description: I would like to prepare a webpart or an application for Sharepoint 2013 foundation. The we

laura

2/12/2013 1:27:49 AM

This a very easy example... the output is:

 Enter the string : Daljit is making programs
 The total number of words in the entered string : 4

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd