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 / sandy880
#include<stdio.h>
#include<conio.h>
#define MAX 15
void main()
{
char arr[MAX];
int i;
clrscr();
printf("Enter your name:");
scanf("%s",arr);
for(i=0;arr[i]!='\0';i++)
{
if(arr[i]>=65&&arr[i]<=90)
{
arr[i]=arr[i]+32;
}
else if(arr[i]>=97&&arr[i]<=122)
{
arr[i]=arr[i]-32;
}
}
printf("output:%s",arr);
getch();
}
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
Which of these functions is safer to use : fgets(), gets()? Why?
please explain every phase in the "SDLC" in the dotnet.
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
Explain how do you use a pointer to a function?
What is volatile variable in c?
How can I use a preprocessorif expression to ?
What is an expression?
How do you determine whether to use a stream function or a low-level function?
write a program for the normal snake games find in most of the mobiles.
Can we use any name in place of argv and argc as command line arguments?
What are the types of pointers?
What is a method in c?
Why pointers are used?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
Explain what are preprocessor directives?