Program to check whether a word starts with a capital
letter or not.
Answer Posted / 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 View All Answers
What are the advantages of polymorphism?
Explain the concepts involved in Object Oriented programming.
What is ambiguity in inheritance?
What is the real time example of inheritance?
What do you mean by variable?
What is destructor example?
What is the highest level of cohesion?
Why do pointers exist?
What is polymorphism and types?
How is polymorphism achieved?
What is the purpose of enum?
What is difference between polymorphism and inheritance?
Is this job good for future? can do this job post grduate student?
What are the features of oop?
can we make game by using c