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

what is the use of bitfields & where do we use them?

2 Answers  


What is the maximum length of an identifier?

0 Answers  


how to swap two integers 1 and 32767 without using third variable

11 Answers   Microsoft, TCS,


What is scope of variable in c?

0 Answers  


Is reference used in C?

1 Answers  






what is data structure?

5 Answers   CBSE,


what is the c source code for the below output? 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1

0 Answers  


Process by which one bit pattern in to another by bit wise operation is?

0 Answers   InterGraph,


how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y

4 Answers   TCS,


WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?

28 Answers   3D PLM, Code Studio, Deltech, IBM,


how to sort two array of characters and make a new array of characters.

1 Answers   Accenture,


Is main is user defined function?

0 Answers  


Categories