Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

if nybody nows the answer thn tell me pls.

Is This Answer Correct ?    11 Yes 4 No

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 / 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 ?    10 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 ?    18 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 4 No

Post New Answer



More C Interview Questions

Is calloc better than malloc?

0 Answers  


write a progrmm in c language take user interface generate table using for loop?

0 Answers  


What is a newline escape sequence?

0 Answers  


#include <stdio.h> int main() { if ("X" <"x") printf("X smaller than x "); } my question is whats the mistake in this program? find it and please tell me..

3 Answers  


1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.

2 Answers  






what is difference between array of characters and string

18 Answers   Accenture, Nest,


Explain 'far' and 'near' pointers in c.

0 Answers  


What is a function simple definition?

0 Answers  


How to create struct variables?

0 Answers  


Explain can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


What is the difference between %d and %*d in C

3 Answers  


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  






Categories