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 is the total generic pointer type?

722


What is indirection in c?

620


What are the types of assignment statements?

624


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1648


Can we initialize extern variable in c?

626






Why we use conio h in c?

580


How do you list a file’s date and time?

626


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

899


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

661


What are the application of c?

639


What are the advantages of using new operator as compared to the function malloc ()?

752


What are 3 types of structures?

590


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

664


What are the properties of union in c?

584


What is the mean of function?

644