Design a program in C to input your name, a friend's name and telephone number. Get the computer to print a message to you to phone your friend on the number given.
Design a program in C language.?
I don't know why people don't just ask for help with something in a program, as opposed to asking for complete source code.
I'll just give you hints:
1) Learn how to use printf() and scanf().
2) Allocate the variables you will need, based on the information you are storing. If you don't know the difference between different data types, go learn that. Do you know how to declare variables? If not, go learn.
3) Write pseudo-code to plan out how your program will work.
Reply:i agree with everyone who is in favour of not doing other homework.. but i still gave u this programm ... u know why ..coz i want u to be a looser ... rest of ur life ..
u wont understand why i places fflush(stdin) after each scanf() statement.. if u dont putit u will get unexpected results .. how will u explain ur teacher why u used fflush() .. ?
is this what u wanted ....... ?
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
void main()
{
char *urname, *fname;
char phno[10];
clrscr();
printf("\n Enter your name: ");
scanf("%s",urname);
fflush(stdin);
printf("\n Enter your friend's name: ");
scanf("%s",fname);
fflush(stdin);
printf("\n Enter your friends phone number: ");
scanf("%s",phno);
fflush(stdin);
clrscr();
printf("\n %s, call ur friend %s on %s ",urname,fname,phno);
getch();
}
*The code submitted by the next user will give unexpected error ..
Reply:Dude, register with http://www.getphpbb.com/phpbb/index.php?...
for exciting C++ Tutorials.
Reply:#include%26lt;stdio.h%26gt;
main()
{
char a[20],b[20],d[20];
clrscr();
printf("Enter your name,friend's name and his phone number\n");
scanf("%s",a);
scanf("%s",b);
scanf("%s",d);
printf("%s, please call %s on the number %s",a,b,d);
getch();
}
Reply:This sounds like yet another student wanting somebody else to do their homework for them.
I could do this program for you, but then you would get all the credit, and I would get nothing.
If you want me to supply your answers for you, how much is it worth to you? How much are you willing to pay a professional programmer to write a program for you, anyway??? (After all, my time is valuable.)
Reply:Have a look at the stdio.h libraries. You should find usefull functions like fprintf(...) to print on screen something and gets(...) to get input text from a user.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment