WAP to accept first name,middle name & last name of a
student display its initials?

Answer Posted / ricky

hi chandan
this is the modification of ur ans
#include<stdio.h>
#include<conio.h>
void main()
{
char fname[20],mname[20],lname[20];
clrscr();
printf("Enter student First Name: ");
scanf("%s",fname);
printf("Enter student Middle Name: ");
scanf("%s",mname);
printf("Enter student Last Name: ");
scanf("%s",lname);
printf("The Output of the Following is: \n");
printf("%c %c %c",fname[0],mname[0],lname[0]);
getch();
}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the scope of local variable in c?

572


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

694


How is a pointer variable declared?

588


What is a nested formula?

599


What are runtime error?

623






What are header files and explain what are its uses in c programming?

605


Explain what will the preprocessor do for a program?

593


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

712


What is a program flowchart?

596


What is void pointers in c?

582


What are the features of the c language?

640


how do you execute a c program in unix.

634


Which is the memory area not included in C program? give the reason

1499


Can main () be called recursively?

621


What is the role of && operator in a program code?

564