Program to check whether a word is in all capital letters
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 |
what is the sylabus for priliminaries?
What is a null tree?
WHAT'S THE OOPS BASIC OOPS CONCEPTS IN DOTNET
143.what is oops principles?
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?
What are the 5 oop principles?
What is a class and object?
what isthe difference between c structure and c++ class
What are the OOPS concepts?
106 Answers A1 Technology, Bajaj, CTS, EDS, HP, Infosys, Intel, Microsoft, MNC, Persistent, PlanetSoft, ProConstructor, TCS, Virtusa, Wipro, YSoft Solutions,
When is an object created and what is its lifetime?
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?
What is public, protected, private?