Horje
c   check first character of string Code Example
how to print the first character of a string in c
#include <stdio.h> 
#include<string.h> 
 
int main(void)  
{ 
	char c[100]; 
	scanf("%s",c); 
	/*strlen(c) gives total length of string . string index starts from 0 
	last index of character is strlen(c)-1*/ 
	int l = strlen(c)-1; 
	printf("%c %c",c[0],c[l]); 
	return 0; 
} 
c check first character of string
#include <stdio.h>

int main(void){
  char b[5];
  scanf("%s",&c);
  printf("Simple answer %c",b[0:4])
}




C

Related
Arrays in C Code Example Arrays in C Code Example
xor in c Code Example xor in c Code Example
helloworld c Code Example helloworld c Code Example
formula to find the area of a trapezium in c Code Example formula to find the area of a trapezium in c Code Example
passing a pointer to a function Code Example passing a pointer to a function Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6