WAP to accept first name,middle name & last name of a
student display its initials?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
what is difference b/w extern & volatile variable??
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
what will be maximum number of comparisons when number of elements are given?
Which function in C can be used to append a string to another string?
Why array is used in c?
Write program to remove duplicate in an array?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
please send me papers for Dy. manager IT , PNB. it would be a great help for me.
What is use of pointer?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }
plz answer..... a program that reads non-negative integer and computes and prints its factorial