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
The ans without using lib function tolower() & toupper()
#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 ? | 7 Yes | 3 No |
Post New Answer View All Answers
With the help of using classes, write a program to add two numbers.
What does 2n 4c mean?
What is meant by gets in c?
What is external variable in c?
What is a far pointer in c?
In a switch statement, what will happen if a break statement is omitted?
How do I convert a string to all upper or lower case?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What are qualifiers?
Why c is called a mid level programming language?
write a program for the normal snake games find in most of the mobiles.
What is void pointers in c?
Lists the benefits of c programming language?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What is the meaning of 2d in c?