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

Answers were Sorted based on User's Feedback



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

Answer / ankush

hiiii Chandan
your answer is wrong...
first you use print this is wrong....it's printf....
&we cant store string in array by using %c operator...
here we use %s to store a string or print a string...

Is This Answer Correct ?    8 Yes 1 No

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

Answer / rina

if nybody nows the answer thn tell me pls.

Is This Answer Correct ?    11 Yes 5 No

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

Answer / ankush

#include<stdio.h>
#include<conio.h>
void main()
{
char fnm[20],snm[10],lnm[10];
clrscr();
printf("Enter student First Name: ");
gets(fnm);
printf("Enter student Middle Name: ");
gets(snm);
printf("Enter student Last Name: ");
gets(lnm);
printf("\nThe Name is: ");
printf("%s %s %s",fnm,snm,lnm);
getch();
}

Is This Answer Correct ?    12 Yes 7 No

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

Answer / chandan kumar r

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

Is This Answer Correct ?    20 Yes 17 No

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

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

More C Interview Questions

What is the general form of a C program?

0 Answers  


Explain how can you restore a redirected standard stream?

0 Answers  


What is putchar() function?

0 Answers  


How can I insert or delete a line (or record) in the middle of a file?

0 Answers  


what is a constant pointer in C

0 Answers  






program to convert a integer to string in c language'

0 Answers  


sum of two integers values only other then integer it should print invalid input.

1 Answers  


what is pointer

1 Answers   TCS,


Example of friendly function in c++

2 Answers  


Do pointers store the address of value or the actual value of a variable?

0 Answers   Fidelity,


FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY?

4 Answers   Wipro,


When should we use pointers in a c program?

0 Answers  


Categories