#include <stdio.h>
//#define 1 true
//#define 0 false
int lower_case (char ch);
int upper_case (char ch );
int to_upper_case (char );
int to_lower_case (char );
int lower_case (char ch)
{
if(ch>='a' && ch<='z')
return 1 ;
else return 0 ;
}
int upper_case (char ch ) // with one parameter (argument)
{
if(ch >='A' && ch<='Z')
return 1 ;
else return 0 ;
}
int to_lower_case (char ch)
{
if(upper_case(ch))
return ch + 32; // ASCII Code table
else return ch;
}
int to_upper_case (char ch )
{ // form small to big
if(lower_case(ch))
return ch - 32; // ASCII Code table
else return ch;
}
int main ()
{
int g,f;
int b,i;
printf("enter a big litter to change it /n");
scanf("%d to change it to lower case %c " ,&g,to_lower_case(f));
printf("enter e small litter to change it to upper case ");
scanf("%d to change it to upper case %c",&b, to_upper_case(i));
return 0;
}
your whole scanf logic is wrong:
- i don't think you want to have all that text in the scanf
- you want to save it to variable, not to a function
klimi
the best for everyone
Mandelbröt
\Device\NUL
mito
artemetra 🇺🇦
꧁𓊈𒆜 ATreeShine 𒆜𓊉꧂
Gilded
Pavel
Ludovic 'Archivist'
Dimka
X
Chri~
Michel
Aristo