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

difference between structure and union.

2 Answers   ADP, Convergys,


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,


What is the difference between Home and $Home?

2 Answers   TCS,


how to get the oracle certification? send me the answer

0 Answers   Oracle,


What type of loop is a for loop?

0 Answers  






WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,


Prepare me a program for the animation of train

0 Answers  


What Is a Polymorphism? How many types of polymorphism and whats that use in application?

2 Answers  


what is the advantage in software? what is the difference between the software developer and Engineer

1 Answers  


What is abstraction with example?

0 Answers  


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

0 Answers  


What are the 4 pillars of oop?

0 Answers  


Categories