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 |
what is the use of bitfields & where do we use them?
What is the maximum length of an identifier?
how to swap two integers 1 and 32767 without using third variable
What is scope of variable in c?
Is reference used in C?
what is data structure?
what is the c source code for the below output? 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1
Process by which one bit pattern in to another by bit wise operation is?
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y
WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?
28 Answers 3D PLM, Code Studio, Deltech, IBM,
how to sort two array of characters and make a new array of characters.
Is main is user defined function?