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
What does and I oop mean in text?
Can we override main method?
What is encapsulation and abstraction? How are they implemented in C++?
#include
What are two types of polymorphism?
What are the benefits of interface?
Who invented oop?
What is difference between data abstraction and encapsulation?
What are the 4 pillars of oop?
#include
What is abstraction in oop with example?
what are the realtime excercises in C++?
What do you mean by variable?
explain sub-type and sub class? atleast u have differ it into 4 points?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.