Program to check whether a word is in all capital letters



Program to check whether a word is in all capital letters..

Answer / shadab alam

using System;
class a
{
public static void Main()
{
Console.WriteLine("Enter a word ");
string s=Console.ReadLine();
char []c=s.ToCharArray();
int ctr=0;
for(int i=0;i<c.Length;i++)
{
if(c[i]>=65 && c[i]<=90)
{
ctr++;
}
else
{
ctr=0;
}

}
if(ctr>0)
{
Console.WriteLine("word are in
capital letter");

}
else
{
Console.WriteLine("word are not in
all capital letter");
}
}
}

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More OOPS Interview Questions

Why interface is used?

0 Answers  


can you give real time example for polymarphism

5 Answers   TCS,


different types of castings

3 Answers   Siemens,


What is Agile methodology?

20 Answers   ABC, Accenture, College School Exams Tests, Inmar, Microsoft, Sapient,


What is the oops and benefits of oops programming?

0 Answers  






what is the use of mutable key word

3 Answers   HCL,


suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?

3 Answers   EA Electronic Arts,


how do you handle yourself when you feel the wald is aganist you

2 Answers  


2. Give the different notations for the class.\

0 Answers  


why constructor cannt be declar virtually? why destructor cannt be overloaded?

2 Answers   Infosys,


What is encapsulation process?

0 Answers  


what are the disadvantages of C++?

25 Answers   ATS, Infosys, UNI, Wipro,


Categories