Search This Blog

Friday, 21 August 2020

ctype function

 #include<iostream>

#include<ctype.h>


using namespace std;

int main()

{

   {

cout<<  " \nisalnum ()"<<"="<<isalnum ('1');

cout<<  " \nisalpha ()"<<"="<<isalpha ('a');

cout<<  " \nisdigit ()"<<"="<<isdigit ('1');

cout<<  " \nislower ()"<<"="<<islower ('w');

cout<<  " \nisupper ()"<<"="<<isupper ('W');

cout<<  " \nisxdigit()"<<"="<<isxdigit('1');

cout<<  " \ntolower ()"<<"="<<tolower ('a');

cout<<  " \ntoupper ()"<<"="<<toupper ('A');

cout<<  " \nisspace ()"<<"="<<isspace (' ');

cout<<endl;

  }

{

char name[20];

int i=1;

cout<<"Enter your name="<<endl;

cin>>name;

while(name[i]!='\0')

{

i++;

}

cout<<"lenght of the name is="<<i;

}

return 0;

}


No comments:

Post a Comment

Search This Blog

Contact Form

Name

Email *

Message *

Popular Posts