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
What are run-time errors?
I need testPalindrome and removeSpace
#include
If fflush wont work, what can I use to flush input?
How to explain the final year project as a fresher please answer with sample project
What is the difference between declaring a variable by constant keyword and #define ing that variable?
what is stack , heap ,code segment,and data segment
What is hashing in c?
What is c language used for?
List some applications of c programming language?
What are the advantages and disadvantages of a heap?
Explain why can’t constant values be used to define an array’s initial size?
How do you define CONSTANT in C?
What is the equivalent code of the following statement in WHILE LOOP format?
How do you determine the length of a string value that was stored in a variable?
Can we use any name in place of argv and argc as command line arguments?