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
Answers were Sorted based on User's Feedback
Answer / ganesh
char s[15];int n,i;
scanf("%s",s,printf("give a name:"));
for(i=0;i<strlen(s);i++)
{
if(s[i]==tolower(s[i]))
putchar(toupper(s[i]));
else
putchar(tolower(s[i]));
}
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / 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 |
Answer / bijoy
#include<stdio.h>
main()
{
printf("your name");
getchar();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain 'bus error'?
What is the use of function overloading in C?
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
What does s c mean in text?
What is difference between array and structure in c?
What is c language in simple words?
Differentiate between the = symbol and == symbol?
Which is more efficient, a switch statement or an if else chain?
Is there a way to compare two structure variables?
what is the difference between procedure oriented and object oriented progaming language
Write code for initializing one dimentional and two dimentional array in a C Program?
5 Answers Deshaw, Edutech, GMD,