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
What are dangling pointers? How are dangling pointers different from memory leaks?
Why does not c have an exponentiation operator?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is difference between && and & in c?
about c language
Explain how can you tell whether two strings are the same?
How can I find the modification date of a file?
What is the general form of #line preprocessor?
Is c still used?
Explain is it valid to address one element beyond the end of an array?
Is c high or low level?
What is the process to generate random numbers in c programming language?
What is an lvalue in c?
What is a method in c?
When should structures be passed by values or by references?