. Write a program to get a string and to convert the 1st
letter of it to uppercase

Answers were Sorted based on User's Feedback



. Write a program to get a string and to convert the 1st letter of it to uppercase..

Answer / darshana

Dim str As String
Dim ch() As Char


Console.WriteLine("enter a string")
str = Console.ReadLine()
ch = str.ToCharArray
Console.Write(Char.ToUpper(ch(0)))




For i As Integer = 0 To ch.GetUpperBound(0) - 1

Console.Write(ch(i + 1))


Next
Console.WriteLine()

Is This Answer Correct ?    2 Yes 1 No

. Write a program to get a string and to convert the 1st letter of it to uppercase..

Answer / kiran

void main()
{
char str[20];
int i=0;
printf("Enter your name : ");
gets(name);
if(str[i] >= 97 && str[i]<=122)
str[i] = str[i] - 32;
printf("The new String is %s",str);
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

0 Answers  


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

0 Answers   Huawei,


Can you apply link and association interchangeably?

0 Answers   InterGraph,


Is c++ based on c?

0 Answers  


why array index always starts from zero??

4 Answers   TCS,






What is the difference between union and structure in c?

0 Answers  


Explain what is a static function?

0 Answers  


What is the heap in c?

0 Answers  


What does 1f stand for?

0 Answers  


Why the use of alloca() is discouraged?

2 Answers   Oracle,


What are the 5 organizational structures?

0 Answers  


Explain output of printf("Hello World"-'A'+'B'); ?

0 Answers  


Categories