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


Please Help Members By Posting Answers For Below Questions

What are the rules for the identifier?

671


What are near, far and huge pointers?

648


How would you rename a function in C?

622


Explain the difference between getch() and getche() in c?

565


write a program to generate address labels using structures?

4007






Where in memory are my variables stored?

637


How do you print only part of a string?

615


Do you know the difference between exit() and _exit() function in c?

609


What are comments and how do you insert it in a C program?

742


What is the size of empty structure in c?

595


What is the ANSI C Standard?

780


What is New modifiers?

669


What is the advantage of an array over individual variables?

744


How do we print only part of a string in c?

587


Which node is more powerful and can handle local information processing or graphics processing?

829