Program to check whether a word starts with a capital
letter or not.



Program to check whether a word starts with a capital letter or not...

Answer / zaideeabu

// Untested possible answer
// Which perhaps combined C & C++ style :P

#include <iostream.h>
#include <string.h>

int main(int argc, char * argv[])
{
char cA = 'A';
char cZ = 'Z';

char str[1024] = {0};

strncpy(str, argv[1], 1024);

if ( str[0] <= cA || str[0] >= cZ )
cout << "String: " << str << " does not start with
capital letter." << endl;
else
cout << "String: " << str << " starts with capital
letter."

return 0;
}

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More OOPS Interview Questions

How to hide the base class functionality in Inheritance?

0 Answers   Viscus Infotech,


what is difference between thread and programme.

1 Answers   NCC,


What does oop mean in snapchat?

0 Answers  


What is namespace?

15 Answers  


What is polymorphism in oops with example?

0 Answers  






for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)

2 Answers  


Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?

5 Answers  


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

0 Answers  


2. Give the different notations for the class.\

0 Answers  


What causes polymorphism?

0 Answers  


program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number

1 Answers   Anna University,


Whats oop mean?

0 Answers  


Categories