## Write the difference between scanf() and printf().

scanf() printf() 1. It means scanning format. So it is an input formatting function. 1. It’s printed format. So, for formatted output it is used. 2. Syntax:scanf(control sequence, var-1,var-2…); 2. Syntax:printf(control sequence, var-1.var-2;……); ORprint(strings); 3. Example:void main(){int x,y;printf (“Enter any two integers” );scanf(“%d%d”,&x,&y);printf(“x=%d,y=%d\n”,x,y);getch();} 3. Example:void main(){float x,y;printf (“Enter any two floats” );scanf(“%f%f”,&x,&y);printf(“x=%2f,y=%2f\n”,x,y);getch();} ﻿

## Write a c program to calculate simple interest.

Logics for calculation of simple interest Input principle amount in some variable say principle. Input time in some variable say time. Input rate in some variable say rate. Find simple interest using formula SI = (principle * time * rate) / 100. Finally, print the resultant value of SI. Output

## write a c program to calculate factorial of user entered number.

what is factorial? Factorial number n is the product of less than or equal to n for all positive integers. It is known as n!. Factorial for example 5 = 1 * 2 * 3 * 4 * 5 = 120 Logic for finding factorial on entered number. Output Enter your number 6 Factorial of […]

## write a program to calculate simple interest and mixed amount, if the principal amount, time and rate of interested is given by the user

Program Output: Input Principal Amount :- 200 Input Time Period :- 2 Input Rate of Interest :- 3 Simple Interest = rs 12.00 Mixed Amount = rs 212.00

## C Program to Check Whether a Number is Prime or Not

A prime number is a positive integer which can be divided by only 1 and itself. For instance: 2 , 3, 5 , 7, 11, 13, 17 … code of the program

## C Program to Print Pyramids and Patterns

Example 1: Half Pyramid of * C Program Example 2: Half Pyramid of Numbers C Program Example 3: Half Pyramid of Alphabets C Program Example 4: Inverted half pyramid of * C Program Example 5: Full Pyramid of * C Program Example 6: Inverted half pyramid of numbers C Program Example 7: Full Pyramid of […]

## C Program to Swap Two Numbers

Code of the Program Output Swap Numbers Without Using Temporary Variables Output Enter a: 10.25Enter b: -12.5After swapping, a = -12.50After swapping, b = 10.25

## C Program to Multiply Two Floating-Point Numbers

Code of the program Output

## C Program to Print an Integer Entered by the User

Code of the Program Output Insert Integer: 20You are Inserted : 20

## C “Hello, World!” Program

In this example, in C programming you’ll learn to print “Hello, World!” on the screen. C Program to Display “Hello, World!” Output Hello, World! How does the program “Hello, World!” work? The #include is a preprocessor command which tells the compiler to include stdio.h (standard input and output) file content into the program. The file stdio.h includes functions such as scanf() […]