Usage of Printf() & scanf()
printf() --- we use printf() for output some thing in c , printf() is a bulit-in function of C, which is define in <stdio.h> header file.
example: write something in printf(),like
printf("Hello freeboighor");
format of printf() function
printf("expected string",argument_list);
we can showing integer, string, float, character etc by printf(), We will do later.
output: Hello freeboighor
scanf() ---- we use scanf() to get value in c , scanf() is also a bulit-in function of C, which is define in <stdio.h> header file.example will show in later.
printf() output those values which you get by scanf() after doing some processing.
Example of printf() & scanf()
#include<stdio.h>
int main(){
int number;
printf("Enter a number:");
scanf("%d",&number);
printf("The number is : %d ",number)
printf("result is : %d ",number*number);
return 0;
}
Output :
Enter a number: 3
The number is : 3
result is : 9
We can also doing Addition ,Subtraction,Division. And have different type of way to do this
we do it later
No comments:
Post a Comment