Westonci.ca offers quick and accurate answers to your questions. Join our community and get the insights you need today. Get accurate and detailed answers to your questions from a dedicated community of experts on our Q&A platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

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*/