Tuesday, 7 July 2015

Entering Input and Displaying Output.

In this blog, we'll learn about ...ugh, i'm dropping the cheesy opening lines. Let's talk business. I'm Syntaxberg, making you an offer you cannot refuse.

What if you could enter any input and obtain the desired output? Won't that be something?

In the last program, we had displayed the output using the "printf" parameter. In this program, we'll use the "scanf" parameter for the input.


#include <stdio.h>
#include <conio.h>
int main()
{int  number;
 printf("How many cannons are ready sailor? \n");
 scanf("%d", &number);  //....1
 printf("Arrrgh! Only %d ?", number);
 getch();}




1. Heave ho! Coming directly  to the  point 1, we come across a great adversity of its kind. Scanf. What does it  do? Well, Scanf is the inputting parameter and it is analogous and umn.. antonym..? of printf. If Printf displays the output, scanf scans the input. So, if Cap'n Blackbeard is asking you how many cannons are ready (and you're fellow mates are too lazy to make 'em ready), the Cap'n will reply in anguish and probably feed you to the sharks.




"Arrrgh! The Sharks or the Blunderbuss, mateys?!"





No comments:

Post a Comment