#include<stdio.h>#include<ctype.h>intmain(void){
int i=0;
char str[]="C++";
while (str[i])
{
if (isalpha(str[i])) printf ("character %c is alphabetic\n",str[i]);
elseprintf ("character %c is not alphabetic\n",str[i]);
i++;
}
return0;
/*
Output:
character C is alphabetic
character + is not alphabetic
character + is not alphabetic
*/
}
#include<stdio.h>#include<ctype.h>intmain(){
int i=0;
char str[]="Test String.\n";
char c;
while (str[i])
{
c=str[i];
putchar (toupper(c));
i++;
}
return0;
/*
Output:
TEST STRING.
*/
}
/* atoi example */#include<stdio.h> /* printf, fgets */#include<stdlib.h> /* atoi */intmain(){
int i;
char buffer[256];
printf ("Enter a number: ");
fgets (buffer, 256, stdin);
i = atoi (buffer);
printf ("The value entered is %d. Its double is %d.\n",i,i*2);
return0;
/*
Output:
Enter a number: 5
The value entered is 5. Its double is 10.
*/
}