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 / rakesh ranjan

#include<conio.h>
#include<stdio.h>
void main()
{
char str[20],i;
printf("enter your name:");
scanf("%s",str);
for(i=0;str[i]!='\0';i++)
{
if(str[i]<=91)
str[i]+=32;
else
str[i]-=32;
printf("%c",str[i]) ;
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string constants?

662


Can a pointer be static?

625


Why do we use namespace feature?

583


Explain how do you declare an array that will hold more than 64kb of data?

904


What is c method?

536






What are the various types of control structures in programming?

628


What is difference between array and structure in c?

580


Explain what is dynamic data structure?

645


What is self-referential structure in c programming?

660


what is the difference between class and unio?

1861


What type of function is main ()?

585


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1705


what does static variable mean?

655


Explain pointer. What are function pointers in C?

628


How can a process change an environment variable in its caller?

656