Program to check whether a word is in all capital letters
Answer Posted / 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 View All Answers
Can static class have constructor?
What is cohesion in oop?
is there any choice in opting subjects like 4 out of 7
Why do we need polymorphism in c#?
What language is oop?
What is static in oop?
How does polymorphism work?
Can enum be null?
How to hide the base class functionality in Inheritance?
What are the 5 oop principles?
What is persistence in oop?
What is encapsulation in oop?
What are oops methods?
What is the use of oops?
Why interface is used?