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
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is the difference between call by value and call by reference in c?
What is void pointers in c?
Is c procedural or functional?
What is maximum size of array in c?
What is meant by 'bit masking'?
I came across some code that puts a (void) cast before each call to printf. Why?
What is the purpose of realloc()?
Is c object oriented?
What are the types of bitwise operator?
Explain how can I pad a string to a known length?
What is a class c rental property?
What is a substring in c?
Explain can you assign a different address to an array tag?
What does dm mean sexually?