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
Explain how can a program be made to print the name of a source file where an error occurs?
Why shouldn’t I start variable names with underscores?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
Why main function is special give two reasons?
What is infinite loop?
What is volatile variable in c?
What is structure padding and packing in c?
What is preprocessor with example?
What is clrscr in c?
What is self-referential structure in c programming?
What is the difference between single charater constant and string constant?
Why #include is used in c language?
What are the salient features of c languages?
hi send me sample aptitude papers of cts?
Which is an example of a structural homology?