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 |
diff. between *p and **p
What are types of preprocessor in c?
HOW TO HANDLE EXCEPTIONS IN C
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)
What are enumerated types?
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output?
why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?
What is self-referential structure in c programming?
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
How do you access command-line arguments?
How is actual parameter different from the formal parameter?
how many error occurs in C language ?