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
Why shouldn’t I start variable names with underscores?
What are the types of functions in c?
Explain what does the format %10.2 mean when included in a printf statement?
Explain how to reverse singly link list.
What is the explanation for prototype function in c?
Multiply an Integer Number by 2 Without Using Multiplication Operator
Explain what is the difference between functions getch() and getche()?
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
Define macros.
Does c have function or method?
How does normalization of huge pointer works?
Explain modulus operator. What are the restrictions of a modulus operator?
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.....
What is c definition?
What is the use of the function in c?