Using functions create a program, C/C++ Programming

In rPeANUt implement the "char getchar()" and "void printstring(char *str)" functions. Using these functions implement the following:

void main() {

   while (1) {

      char c = getchar();

      if (c == 'a') {

         printf("A - apple\n");

      } else if (c == 'b'){

         printf("B - ball\n");

      } else if (c == 'c'){

         printf("C - cat\n");

      } else {

         printf("%c - ??\n", c);

      }

   }

}

Posted Date: 3/8/2013 6:22:30 AM | Location : United States







Related Discussions:- Using functions create a program, Assignment Help, Ask Question on Using functions create a program, Get Answer, Expert's Help, Using functions create a program Discussions

Write discussion on Using functions create a program
Your posts are moderated
Related Questions
What is copy constructor? describe the concept of copy constructor.

#include stdio.h> #include conio.h> #include string.h>   void del(char[],char *); main() {           char str[30],ch,*pp;           clrscr();           p

program to convert string from super ascii string with minimum cost

C program to string compression: Write a program to define a sting and all operations on string. void main()                                 {

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion

Define Polymorphism? A: Polymorphism let a client to treat distinct objects in the similar way even if they were developed from distinct classes and exhibit different behaviors.

Manipulators There are several classes in the iostream.h header file. One of them is ios class. This class stores the format state. For example, some bits explain the base in w

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi

Develop a program to meet the following requirements: 1. Must use at least one function in addition to main (you can use more) 2. Must use selection 3. Must use deference/indire

If an array holds integer, each of which is four bytes long, how many bytes from the base location of the array is the location of the fifth element?