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

Why shouldn’t I start variable names with underscores?

623


What are the types of functions in c?

570


Explain what does the format %10.2 mean when included in a printf statement?

780


Explain how to reverse singly link list.

606


What is the explanation for prototype function in c?

568






Multiply an Integer Number by 2 Without Using Multiplication Operator

320


Explain what is the difference between functions getch() and getche()?

606


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1451


Define macros.

785


Does c have function or method?

591


How does normalization of huge pointer works?

637


Explain modulus operator. What are the restrictions of a modulus operator?

600


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1372


What is c definition?

743


What is the use of the function in c?

598