Program - 1: / Write A Program To Print Your Name Using Printf Statement.
Program - 1: / Write A Program To Print Your Name Using Printf Statement.
OUTPUT: -
PROGRAM 2
\* Write a program for addition, subtraction, multiplication and division of two numbers. *\
INPUT: #include<stdio.h> #include<conio.h> void main() { int a,b,sum,sub,mul; float div; clrscr(); printf("Enter value of a"); scanf("%d",& a); printf("Enter value of b"); scanf("%d",& b); sum=a+b; sub=a-b; mul=a*b; div=a/b; printf("sum=%d",sum); printf("\nsub=%d",sub); printf("\nmul=%d",mul); printf("\ndiv=%f",div); getch(); }
OUTPUT: -
PROGRAM 3
\* Write a program to calculate simple interest. *\
INPUT: #include<stdio.h> #include<conio.h> void main() { int p,r,t; float SI; clrscr(); printf("Enter the value of p"); scanf("%d",& p); printf("Enter the value of r"); scanf("%d",& r); printf("Enter the value of t"); scanf("%d",& t); SI=p*r*t/100; printf("Simple Interest=%f",SI); getch(); }
OUTPUT: -
PROGRAM 4
\* Write a program to find whether student is Pass or not using simple if. *\
INPUT: #include<stdio.h> #include<conio.h> void main() { int marks; clrscr(); printf("Enter the marks"); scanf("%d",& marks); if(marks>=40) { printf("Pass"); } getch(); }
OUTPUT: -