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
What is the total generic pointer type?
What is indirection in c?
What are the types of assignment statements?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
Can we initialize extern variable in c?
Why we use conio h in c?
How do you list a file’s date and time?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What are the application of c?
What are the advantages of using new operator as compared to the function malloc ()?
What are 3 types of structures?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What are the properties of union in c?
What is the mean of function?