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

write c program without semicolon

11 Answers   MindTech, TCS, Wipro,


Write a program that his output 1 12 123

0 Answers  


write c program to display output 10(10+20)+(10+20+30)+ ... n term

0 Answers   Hindustan Gum Chemicals,


how do you redirect stdout value from a program to a file?

1 Answers  


program to find middle element of linklist?

1 Answers   Huawei,


Write a code of a general series where the next element is the sum of last k terms.

1 Answers   Aspiring Minds,


Explain the advantages and disadvantages of macros.

1 Answers   TCS,


how to create duplicate link list using C???

1 Answers  


A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.

4 Answers  


What is the difference between call by value and call by reference in c?

1 Answers  


What is union in c?

1 Answers  


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

1 Answers  


Categories