How to get a division of 2 numbers in c language. Division of two integer number in c Division of 2 integer number: here we want to get a division of 2 number so for that we have to take 3 variable 1st is for Dividend, 2nd is for divisor and, 3rd is for an answer. the simple logic is a= b/c. here variable "a" get value which is the division of b and c in other words we can say that a is the answer of b divide by c. we show you to way to get an answer. 1) In this way, we have to just take the answer in 3rd variable, and then after we have to print that variable. hear we take div as answer variable. Example:: #include<stdio.h> #include<conio.h> void main() { int a,b,div; clrscr(); printf("\nWelcome,CoderFact\n---------------Division---------------"); printf("\nEnter a First Number(Divisior) :"); scanf("%d",&a); printf("\nEnter a S...
Hiii friends,
Interesting fact about printf and scanf Function. you can count total number of character in printef statement by using simple code and logic.
so for that you have to pass printf function to any integer variable and print that integer variable
and you can able to get how many characters in printf statement
same thing is possible with scanf function.
code for that Program
Example:
#include<stdio.h>
#include<conio.h>
void main ()
{
int b,c,d;
int s=scanf (" %d %d %d",&b,&c,&d);
int a=printf("CoderFact\n");// count the character
clrscr();
printf("printf total character %d \n ",a);
printf ("scanf total read character %d",s);
getch();
}
Output:
-----------------------------------------------------------------------------------------------------------------------------
For Video Tutorial : Click Here
Best Fact.Very interesting fact bhai
ReplyDelete