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

What is an orthogonal base class?

2 Answers  


Can static class have constructor?

0 Answers  


When is a memory allocated to a class?

11 Answers  


Can we call a base class method without creating instance?

6 Answers  


c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess

1 Answers   HCL, TCS,






What are the different forms of polymorphism??

8 Answers   Mantaq, NUC, PCS,


What is coupling in oops?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,


what is the drawback of classical methods in oops?

0 Answers  


What is Virtual Keyword?

9 Answers   IBM, NA,


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

0 Answers   Accenture,


Why is object oriented programming so hard?

0 Answers  


Categories