IDNLearn.com is designed to help you find accurate answers with ease. Discover the information you need from our experienced professionals who provide accurate and reliable answers to all your questions.

Write a C Program to Print the initial letter of Name Ferdous


Sagot :

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The question is about writing a C program that prints the initial letter of Name Ferdous.

Therefore, below is the given complete code that prints the first letter of the name Ferdous.

#include <stdio.h> /*import strandard input/output library*/

#include<string.h> /*import string library to handle string type of data*/

int main(void) /*started the program execution- program entry point*/

{

char *str = "Firdous";   /*char to pointer str contains string "Firdous"*/

int len = strlen(str);   /*this line of code is not neccary, but if you print other character for example last character of the name then you can use it*/

printf("First Letter of the name is: %c", str[0]);  /*print first letter of the name*/

}  /**program terminated*/