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 |
What is oops with example?
What is a friend function & its advantage?
What is the difference between class and object?
What is class and object in oops?
tell about copy constructor
143.what is oops principles?
what is difference between c++ language and java language
When is it necessary to use member-wise initialization list in C++?
What is overriding vs overloading?
What does it mean when someone says I oop?
define oops with class and object
What is polymorphism used for?