differnce between printf() and scanf()
Answers
Answered by
2
scan means to take an perfect image of the page
print means to take out any image or document in reality
print means to take out any image or document in reality
gajindergulatipazajl:
thanks
Answered by
12
Short note on printf and scanf in C language:
(1) Printf:
= > It is used to display the output onto the output screen.
= > It is stored in <stdio.h>
= > It returns the number of bytes.
= > Syntax: printf("format string", arguments);
(2) Scanf:
= > It is used to take input from the user.
= > It is stored in <stdio.h>
= > It does not return anything.
= > Syntax: Scanf("Format string", arguments);
Example:
#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter two numbers");
scanf("%d%d", &a,&b);
c = a + b;
printf("Addition is: %d\n",c);
getch();
}
Hope this helps!
(1) Printf:
= > It is used to display the output onto the output screen.
= > It is stored in <stdio.h>
= > It returns the number of bytes.
= > Syntax: printf("format string", arguments);
(2) Scanf:
= > It is used to take input from the user.
= > It is stored in <stdio.h>
= > It does not return anything.
= > Syntax: Scanf("Format string", arguments);
Example:
#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter two numbers");
scanf("%d%d", &a,&b);
c = a + b;
printf("Addition is: %d\n",c);
getch();
}
Hope this helps!
Similar questions