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
The code contains two built-in pitfalls. First one, if it executes in a member function for an static, extern or automatic object, the program will possibly crash as soon as the de

How to write a function template A function template should be written at the beginning of the program in the global area, or you may place it into a header file. All function

Define Bitwise-Shift Operators? The shift operators perform suitable shift by operator on the right to the operator on the left. The right operator should be positive. The va

Should I call a destructor explicitly on a local variable?


Project Description: I want a person who will be able to program a flex PCB for my device as i meet the person i will be able to describe all my needs Skills required are C P

Aim: Write a program of multipication using inline function class Multiply {           int x,y;           public:           void getdata();           inline calc

Simple program of c++: int main() {    int   bushels;    float dollars, rate;                 cout                 cin >> dollars;                 cout

Explain about the Floating point Constants in c language? A floating point constant is the number that contains either a fraction or decimal part. If an exponent is present its

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome