. 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

Is c dynamically typed?

0 Answers  


what is diffrence between string and character array?

1 Answers  


How to implement a packet in C

0 Answers   Aricent,


What will be your course of action for a push operation?

0 Answers  


What is the advantage of a random access file?

0 Answers  






#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

0 Answers   Wilco,


What is the difference between getch() and getche()?

1 Answers   NSPL,


Difference between MAC vs. IP Addressing

0 Answers  


Why do we need a structure?

0 Answers  


Differentiate between calloc and malloc.

0 Answers   Wipro,


Write a program for finding factorial of a number.

0 Answers   Tech Mahindra,


Is it acceptable to declare/define a variable in a c header?

0 Answers  


Categories