Westonci.ca connects you with experts who provide insightful answers to your questions. Join us today and start learning! Explore a wealth of knowledge from professionals across different disciplines on our comprehensive platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly 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*/