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 |
Can private class be inherited?
What are the advantages of inheritance?
26 Answers IBS, TCS,
define oops concept with example
What are virtual functions?
What is abstraction encapsulation?
Polymorphism with an example?
why the argument is passed by reference to a copy constructor?example?
What is the real time example of encapsulation?
What do you mean by stack program? Get me an example stack program?
what is difference b/w object based and object oriented programming language?
18 Answers Chaitanya, College School Exams Tests, Educomp, IBM, Infosys, Telko,
write a program which best describes polymorphism in real world?
2 Answers CTS, Infosys, NexGen,
Can an interface inherit a class?