Skip to main content

Posts

How to get division of 2 integer number in c language. || division program in c language.

  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...
Recent posts

Sum of two integer number in c language || C Program to find sum of two numbers

Sum of 2 integer numbers in c language.// How to print sum of 2 numbers in c language. Sum of two integer number Sum of 2 integer number: For a sum of 2 integer numbers, we have to take 3 integer variables. 2 for value which we have to add. example: Int a,b; These 2 variable gets value from the user which we have to get addition.  Let's take a=3 and b=2. 1 for an answer where we get the sum of 2 numbers. This variable takes for an answer.  This variable gives us the sum of 2 numbers. For example:  Int sum; Sum=a+b; So sum variable has a value that is an addition of 2 and 3.  And we get answer sum=5. Example:: #include<stdio.h> #include<conio.h> void main() {     int a,b,add;     clrscr();     printf("\nWelcome,CoderFact\n---------------Sum---------------");     printf("\nEnter a First Number :");     scanf("%d",&a);     printf("\nEnter a Second Number :");     scanf("%d",&b); ...

Useful Formula for Programmar

  Simple Interest  ::                                     Si =(p* n*r)/100 Area of Square ::                                                          Area =side* side Area of Rectangle ::                                                           Area = length * breadth Area of Right angled triangle ::                                               Area =(...

scan two number using 1 scanf

  Example:: #include<stdio.h> #include<conio.h> void main() {     int a,b;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a number (2 Times) : ");     scanf("%d %d",&a,&b);     printf("\nEntered numbers  :  %d  %d",a,b);     getch(); } Output::

How to Convert ASCII To character and character To ASCII in c || 1 line code

  Example :: #include<stdio.h> #include<conio.h> void main() {     char a;     clrscr();     printf("\nWelcome,CoderFact\n---------------ASCII---------------");     printf("\nEnter a Charcter(only one charcter):");     scanf("%c",&a);     printf("\n--------------Answer--------------\nASCII Number is %d",a);     getch(); } Output :: Example :: #include<stdio.h> #include<stdio.h> #include<conio.h> void main() {     int a;     clrscr();     printf("\nWelcome,CoderFact\n---------------ASCII---------------");     printf("\nEnter a  ASCII Number   :");     scanf("%d",&a);     printf("\n--------------Answer--------------\n Charcter is %c",a);     getch(); } Output ::

How to convert Integer To Octal and Octal To Integer in c || 1 line code

  Integer To Octal Example :: #include<stdio.h> #include<conio.h> void main() {     int no;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a Integer number : ");     scanf("%d",&no);     printf("Octal number is :  %o",no);     getch(); } Output :: Example :: #include<stdio.h> #include<conio.h> void main() {     int no;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a  Octal number : ");     scanf("%o",&no);     printf(" Integer   number is :  %d",no);     getch(); } Output ::

How to Convert Integer To HexaDecimal and HexaDecimal To Integer in c || 1 line code

   Integer To HexaDecimal Example :: #include<stdio.h> #include<conio.h> void main() {     int no;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a Integer number : ");     scanf("%d",&no);     printf("Hexadecimal number is :  %x",no);     getch(); } Output :: Output of program  HexaDecimal  To Integer  in c Example :: #include<stdio.h> #include<conio.h> void main() {     int no;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a  Hexadecimal  number : ");          scanf("%x",&no);     printf("Integer number is :  %d",no);     getch(); } Output ::