write a c program for print your name .but,your name may be small
letter mean print a capital letter or your name may be capital
letter mean print a small letter .example
\\enter ur name :
sankar
The name is: SANKAR
(or)
enter your name:SAnkar
The name is:saNKAR
Answer Posted / vadivelt
The ans without using lib function tolower() & toupper()
#include<stdio.h>
#include<conio.h>
void LowrUprCase(char *ptr);
int main()
{
char ptr[100];
printf("ENTER THE NAME:\n");
gets(ptr);
LowrUprCase(ptr);
printf("\nOUTPUT: %s \n",ptr);
getch();
}
void LowrUprCase(char *ptr)
{
while(*ptr != '\0')
{
if(*ptr >= 97 && *ptr <= 122)
{
*ptr = *ptr - 32;
}
else if(*ptr >= 65 && *ptr <= 90)
{
*ptr = *ptr + 32;
}
ptr++;
}
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
Can the “if” function be used in comparing strings?
What is #define?
What are identifiers in c?
Can we declare function inside main?
Can a function argument have default value?
How can I dynamically allocate arrays?
What are identifiers and keywords in c?
Explain how can I avoid the abort, retry, fail messages?
Explain continue keyword in c
Explain how do you determine whether to use a stream function or a low-level function?
How can I get random integers in a certain range?
Why is #define used?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Multiply an Integer Number by 2 Without Using Multiplication Operator
What are the 4 types of organizational structures?