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 is constructor overloading in oop?
What are main features of oop?
What does and I oop mean?
What are the benefits of oop?
What is difference between inheritance and polymorphism?
What is basic concept of oop?
What is the renewal class?
What is inheritance in oop?
What is the use of oops?
What is polymorphism what are the different types of polymorphism?
What is difference between polymorphism and inheritance?
How do you define social class?
what is the sylabus for priliminaries?
Why do pointers exist?
What is this pointer in oop?