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 we use visual studio for c?
What is the purpose of 'register' keyword?
Differentiate between the = symbol and == symbol?
how many key words availabel in c a) 28 b) 31 c) 32
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
Explain is it better to bitshift a value than to multiply by 2?
What are the advantage of c language?
What is a c token and types of c tokens?
What is indirection in c?
What is volatile keyword in c?
How do I convert a string to all upper or lower case?
How can I dynamically allocate arrays?
What is a nested formula?
Distinguish between actual and formal arguments.
Who is the founder of c language?