Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main() {
- char name1[] = "AM";
- char name2[] = "AMP";
- char name3[] = "AMP";
- // First name, is smaller than second!
- if( strcmp(name1,name2) < 0){
- cout<<"First name, is smaller than second!"<<endl;
- }
- cout<<endl;
- // second name, is larger than First name!
- if( strcmp(name2,name1) > 0){
- cout<<"second name, is larger than First name!"<<endl;
- }
- cout<<endl;
- // Are of same size
- if( strcmp(name2,name3) == 0){
- cout<<"Are of same size"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement