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 |
will u give me old quesrion papers for aptitude for L & t info tech?
Difference between C and Embedded C?
How do you convert strings to numbers in C?
Why functions are used in c?
program that accepts amount in figures and print that in words
2 Answers Infosys, Lovely Professional University, Wipro,
What does nil mean in c?
what is real time system?what is the differance between hard and soft real time systems
Do pointers store the address of value or the actual value of a variable?
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?
What is operator precedence?
What is 1d array in c?
What are the types of c language?