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
#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 ? | 9 Yes | 3 No |
Post New Answer View All Answers
Are local variables initialized to zero by default in c?
What is the difference between Printf(..) and sprint(...) ?
There seem to be a few missing operators ..
What is the difference between single charater constant and string constant?
What is a void * in c?
How do you determine whether to use a stream function or a low-level function?
Write a C program to count the number of email on text
What is declaration and definition in c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is oops c?
Tell us bitwise shift operators?
Explain is it valid to address one element beyond the end of an array?
Explain what is the purpose of "extern" keyword in a function declaration?
What is a pointer in c plus plus?
What are identifiers c?