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

Answers were Sorted based on User's Feedback



write a c program for print your name .but,your name may be small letter mean print a capital lette..

Answer / ganesh

char s[15];int n,i;
scanf("%s",s,printf("give a name:"));
for(i=0;i<strlen(s);i++)
{
if(s[i]==tolower(s[i]))
putchar(toupper(s[i]));
else
putchar(tolower(s[i]));
}

Is This Answer Correct ?    13 Yes 0 No

write a c program for print your name .but,your name may be small letter mean print a capital lette..

Answer / vadivelt

The ans without using lib function tolower() & toupper()

#include<stdio.h>
#include<conio.h>
void LowrUprCase(char *ptr);
int main()
{
char ptr[100];
printf("ENTER THE NAME:\n");
gets(ptr);
LowrUprCase(ptr);
printf("\nOUTPUT: %s \n",ptr);
getch();
}

void LowrUprCase(char *ptr)
{
while(*ptr != '\0')
{
if(*ptr >= 97 && *ptr <= 122)
{
*ptr = *ptr - 32;
}

else if(*ptr >= 65 && *ptr <= 90)
{
*ptr = *ptr + 32;
}
ptr++;
}
}

Is This Answer Correct ?    7 Yes 3 No

write a c program for print your name .but,your name may be small letter mean print a capital lette..

Answer / bijoy

#include<stdio.h>
main()
{
printf("your name");
getchar();
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

2. Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers.

3 Answers   Nagarro,


what is available in C language but not in C++?

10 Answers   CTS, TCS,


How to Throw some light on the splay trees?

0 Answers  


what is the format specifier for printing a pointer value?

0 Answers  


What are the modifiers available in c programming language?

0 Answers  






What is a built-in function in C?

1 Answers  


implement NAND gate logic in C code without using any bitwise operatior.

4 Answers   Alcatel,


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

0 Answers   Wilco,


Explain in detail how strset (string handling function works )pls explain it with an example.

1 Answers  


What is a protocol in c?

0 Answers  


where do we use volatile keyword?

1 Answers  


Define function pointers?

1 Answers  


Categories