how to print the first character of a string in c

Solutions on MaxInterview for how to print the first character of a string in c by the best coders in the world

showing results for - "how to print the first character of a string in c"
Caleigh
17 Feb 2016
1// c char str[](single string)
2array[0]
3// c char str[] (multiple string)
4array[0][0]
5// c++ std::stirng s;
6s[0]
Carlos
17 Aug 2019
1#include <stdio.h> 
2#include<string.h> 
3 
4int main(void)  
5{ 
6	char c[100]; 
7	scanf("%s",c); 
8	/*strlen(c) gives total length of string . string index starts from 0 
9	last index of character is strlen(c)-1*/ 
10	int l = strlen(c)-1; 
11	printf("%c %c",c[0],c[l]); 
12	return 0; 
13} 
Nile
21 Jan 2016
1#include <stdio.h>
2
3int main(void){
4  char b[5];
5  scanf("%s",&c);
6  printf("Simple answer %c",b[0:4])
7}
queries leading to this page
embedded c check first char of stringfirst item of a string in cc get first char of wordget first character of string pointer chow to print first word of a string in chow to get first char from string cc get first char of stringfirst 4 characters of string cc check first character of stringc get first n characters of stringaccess first character of a string cc printf string first n charactersget first character of string cc string get first wordget first letter of string in chow to print first five character of string in cc program that check first letter of a string is in uppercasehow to take the first charater of a string in cfunction that returns the first word of a string in chow to see 1st character of string in cget first character chow to print first letter of a snetence in cc get first 4 characters of stringhow to print the first character of a string in cfirst letter of string in chow to store first letter of a string in cfind first charcater in string cc get first character of charc get first character of numberc get first character of stringhow to check if the first letter of a string in chow to get first character of a string in objective creturn first word of a string in function in c c if first character of stringc first character of stringget first characters of string cc how take first letter of charhow to get first word of a string in chow to find first character of all the words in a string in cc check first character of stringhow to check the first letter of a string in cget first n characters of string cget first element of a string cc compare first character of stringhow to print first two character of string in chow to display the first character of a string in c 5cfirst char in a string ctake first letter of string cgetting the first character of a string in cfind the first char in a string chow to print first letter of a string in cget first letter of string chow to find first of char in string in cget first term in c charhow to get first element of a string in cfirst letter from string chow to print the first character of a string in c