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


Please Help Members By Posting Answers For Below Questions

Are local variables initialized to zero by default in c?

559


What is the difference between Printf(..) and sprint(...) ?

798


There seem to be a few missing operators ..

625


What is the difference between single charater constant and string constant?

632


What is a void * in c?

604






How do you determine whether to use a stream function or a low-level function?

666


Write a C program to count the number of email on text

1426


What is declaration and definition in c?

535


How can I rethow can I return a sequence of random numbers which dont repeat at all?

716


What is oops c?

625


Tell us bitwise shift operators?

608


Explain is it valid to address one element beyond the end of an array?

743


Explain what is the purpose of "extern" keyword in a function declaration?

631


What is a pointer in c plus plus?

702


What are identifiers c?

575