Posts

Showing posts from January, 2020

Program 3: Show addition, Subtraction, Multiplication, Division and Remainder of any two numbers

#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=6; int b=5; int c,d,e,f; c=a+b; d=a-b; e=a*b; f=a/b; g=a%b; printf("addition=%d",c); printf("\nsubtraction=%d",d); printf("\nmultiplication=%d",e); printf("\ndivision=%d",f); printf("\nremainder=%d",g); getch(); } Output addition=11 subtraction=1 multiplication=30 division=1 remainder=1 Explanation Here two numbers are assigned in varriable a and b and other varriables c,d,e,f and g are declared for storing the results of addition, subtraction, multiplication, division and remainder respectively. "%" is used to find remainder. "%d" is a specifier of integer. Here "\n" is a specifier that is used to print the text in new line. Exercise:  Find out  simple interest where principal is 2000, time is 3 years and rate is 2% using a C program.

Impact Of Computer

D evelopment of Technology has direct effect on our daily lives. This is the era of computer and everybody know how this has brought a major change in our livelihood. With the advance growth in technology since the early computers made in 1946 we have seen a quantam leap in changes made that has affected us both in our present lives and future. The computer has been considered as the greatest invention of 21st century whereas it is also blamed for many day-to-day problems and even tragic events. Positive Impact of computer The work can be done in very less time More information can be stored in small space Multitasking and  multiprocessing capability Greater access to resources Impartially Documents can be kept secret Error Free result  Helps in scientific as well as for education research etc Negative Impact of Computer Highly Expensive Increased Unemployment Data Piracy Computer/Cyber Cribe No age restriction on pronography People can make a negative res...

Program 2- Program to add two numbers

Image
#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=5; int b=7; int c; c=a+b; printf("Addition=%d", c); getch(); } Output Addition=12 Explanation int denotes that variable a can store only integer number so number 5 is provided to it. Varriable c is declared as integer and addition of the number a and b is now placed to c for mathematical calculation. Now to print the result, we have given %d as specifier of interger that holds the value of c. Exercise: Make a program that add 3 numbers.

Program 1- To Print "Welcome To Bit"

Image
#include<stdio.h> #include<conio.h> void main() { clrscr(); printf("Welcome To Bit"); getch(); } Output Welcome To Bit Explanation: #include<stdio.h> and #include<conio.h> is a header file and should be written in the same manner, beginning with #include and written in angular bracket "<" , ">". Here stdio.h defines printf to perform its function and conio.h defines a compiler inorder to translate C program to machine language program. Exercise: Write a program to print "Welcome To Bit" five times.  hint: just use printf("Welcome to Bit") for five times in the block of C program.