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 is polymorphism in oops with example?
Can enum be null?
What is encapsulation in ict?
What is abstraction in oop with example?
Which language is not a true object oriented programming language?
What is the purpose of polymorphism?
Get me an image implementation program.
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is the difference between a constructor and a destructor?
officer say me - i am offered to a smoking , then what can you say
What is polymorphism explain its types?
What are the features of oop?
What is byval and byref? What are differences between them?
What is coupling in oop?