Skip to main content

Posts

Showing posts from April, 2021

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

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 ::

What is use of Scanf Function in C Language || 100% you don't know this type of working in programing language

 Uses Of " scanf " function in C language. scanf Function:          syntax of scanf:  scanf (const char *format, Object *arg(s))          scanf if a function which is use for scan an input from user. scanf is a library function which in  standard   input output library. scanf is some ware like as prinf function. scanf function scan a input from an user via standard input (keyboard).         scanf  function is derived from  #include<stdio.h> library ( Standard input output libraries.) Hear we will see some example of different type of value scan by scanf . 1) For integer Value scan. Example : #include<stdio.h> #include<conio.h> void main() {     int a;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a number : ");     scanf("%d", &a);     printf("Your entered a number...

scanf all possible method

  Example:: #include<stdio.h> #include<conio.h> void main() {     float a;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a float number : ");     scanf("%f", &a);     printf("Your entered a number is :  %f",a);     getch(); } OUTPUT:: size vadhre input kari atle scanf ma 1 space vadhare atle Example:: #include<stdio.h> #include<conio.h> void main() {     float a;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a float number : ");     scanf("%f ", &a);     printf("Your entered a number is :  %f",a);     getch(); } OUTPUT:: scanf ma %f na badle  %d  atle Example:: #include<stdio.h> #include<conio.h> void main() {     float a;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a floa...

Subtraction two number in c || New style two variable and three variable 2 program

  Subtraction of two integer number in c Example:: #include<stdio.h> #include<conio.h> void main() {     int a,b,sub;     clrscr();     printf("\nWelcome,CoderFact\n------------Subtraction------------");     printf("\nEnter a First Number :");     scanf("%d",&a);     printf("\nEnter a Second Number :");     scanf("%d",&b);     sub=a-b;     printf("\n------------Answer------------\nTwo Number subtraction is %d",sub);     getch(); } OUTPUT:: Two Number subtraction in c Two variable Example:: #include<stdio.h> #include<conio.h> void main() {     int a,b;     clrscr();     printf("\nWelcome,CoderFact\n------------Subtraction------------");     printf("\nEnter a First Number :");     scanf("%d",&a);     printf("\nEnter a Second Number :");     scanf("%d",&b);     printf(...

Two Number Multiplication in c || New style two variable and three variable 2 program

  Multiplication of two integer number in c Example:: #include<stdio.h> #include<conio.h> void main() {    int a,b,mul;     clrscr();     printf("\nWelcome,CoderFact\n------------Multiplication------------");     printf("\nEnter a First Number :");     scanf("%d",&a);     printf("\nEnter a Second Number :");     scanf("%d",&b);     mul=a*b;     printf("\n------------Answer------------\nTwo Number Multiplication is %d",mul);     getch(); } OUTPUT:: Multiplication two number Example:: #include<stdio.h> #include<conio.h> void main() {    int a,b;     clrscr();     printf("\nWelcome,CoderFact\n------------Multiplication------------");     printf("\nEnter a First Number :");     scanf("%d",&a);     printf("\nEnter a Second Number :");     scanf("%d",&b);     printf("\n--...

How to Newline in C Language || Without use \n newline in c

What is the use of \n keyword in C language? use of \n (newline)          In C Language "\n" is a special character. "\n" is used to send a pointer to the next line. So for avoiding a mixer of 2 sentences in output, we use \n, which makes an output or execution of code from the new line, basically,  we use \ n  to print the output in the next line of an output screen  in C language.  form example we can understand batter, hear we explain you by 2 different programs that how \n in work. Example :: #include<stdio.h> #include<conio.h> void main() {  clrscr();  printf("Welcome To CoderFact.");  printf("It's All about IT(Information Technology) fact.");  printf("This is Example of c Language.");  getch(); } OUTPUT:: hear you see that without \n the output is not proper. hear we print different sentences in the new printf function but printf function is not used to give a new line in the output. so for a ne...

How to print folat numbers in c language and what are the formation of float variable.

How to print float number in c language.  Floating numbers are basically real numbers.  if we want to print folat numbers in c language for that we have to take %f as keyword in printf and scanf function.  Example : For scanning: Scanf("%f",&variable name); For printing: Printf("foat num is %f.",variable name); There are Diffrent formats  to print float number in c language. Hear we take 1 example which shows you that if we want to print 2 digit after "." Than we have to just write " .2 " in calling printf sattment.  Example: #include<stdio.h> #include<conio.h> void main() {     float a;     clrscr();     printf("\nWelcome,CoderFact");     printf("\nEnter a number : ");     scanf("%f", &a);     printf("Your entered a number is :  %.2f " , a);     getch(); } OUTPUT:: Hear we pass value 12 and we get output  12.00 this thing is occur due to we take input as float nu...

Use of \t (tab) in C Language.

   What is the use of tab ("\t") in c language. use of \t (tab)          basically it work same as tab key which you use is notepade  and ms-word. "\t" is use to give a tab in output of c language program. tab is a group of 4 spaces.  you can see some code and output for example of "\t".    In example you can better understand.  Example :: #include<stdio.h> #include<conio.h> void main() {     clrscr();     printf("\tW\te\tl\tc\to\tm\te\t,\tCoderFact");     getch(); } OUTPUT :: hear we use "\t" after every character of  "welcome" word  and you see that "\t"(tab)  separate  all its character by tab.

"Hello World" Program of C Language || First Program

C language: "hello world"  program  Code:  #include<stdio.h> #include<conio.h> void main() {          clrscr();          printf("hello world");          getch(); } OUTPUT: Program how it's work #include<stdio.h> and #include<conio.h> are basic library of C language  void main() is a funtion that use for execution of programm clrscr() is use for clear the output screen printf() function is use for write any things on output screen getch() is make output screen freeze until it get any character.   For video Tutorial    Click here       

Printf and scanf Hidden features || 1 line code || C Language

  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 ho...