Wednesday 7 March 2018

Input and output in C programming

Input and output in C:-

 In C programming you can use Scanf() and Printf () function to read and print data. 

Example:


 #include<stdio.h>
void main() { int a,b,c; printf("enter any two numbers: \n"); scanf("%d %d", &a, &b); c = a + b; printf("addition of two number is: %d", c); }

Output:-

enter any two numbers:
15
5

addition of two number is:  20
Note:
Scanf() : is used to take input from the user.
Printf (): is used to display  result on the screen.


For more info click here

No comments:

Post a Comment