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
What is string constants?
Can a pointer be static?
Why do we use namespace feature?
Explain how do you declare an array that will hold more than 64kb of data?
What is c method?
What are the various types of control structures in programming?
What is difference between array and structure in c?
Explain what is dynamic data structure?
What is self-referential structure in c programming?
what is the difference between class and unio?
What type of function is main ()?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
what does static variable mean?
Explain pointer. What are function pointers in C?
How can a process change an environment variable in its caller?