Posts

Showing posts from 2016

To find the grades of student by nested if,else loops

Image
To find the grades of student by nested if,else loops:- #include<stdio.h> #include<conio.h> void main() { int marks; clrscr(); printf("enter your marks out of 100 = "); scanf("%d",&marks); if(marks>80) { printf("your grade is A"); } else { if(marks>50) printf("your grade is B"); else { printf("your grade is C"); } } getch(); } Output:-

check variable value is greater then 10 or not

Image
check variable value is greater then 10 or not:- #include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); printf("enter the value of a = "); scanf("%d",&a); if(a>10) {printf("the value of a is greater then 10");} else {printf("the value of a is smaller then 10");} getch(); }                                      Output:-

Programm to evaluate expression

Image
Programm to evaluate expression:- #include<stdio.h> #include<conio.h> void main() { int a,b,c; float k; clrscr(); printf("enter the value of a = "); scanf("%d",&a); printf("enter the value of b = "); scanf("%d",&b); printf("enter the value of c = "); scanf("%d",&c); k=((a*b)+c)*((2.5*a)+b); printf("value of k is = %f ",k); getch(); } Output:-

how to root your phone easily

Image

c pragram to print hello world

Image
Programm for print "hello world" :- #include<stdio.h> #include<conio.h> void main() { clrscr(); printf("hello world"); getch(); }

c program for addition

Image
Programm for addition :- #include<stdio.h> #include<conio.h> void main() { clrscr(); int a,b,c; printf("enter the value of a="); scanf("%d",&a); printf("enter the value of b="); scanf("%d",&b); c=a+b; printf("sum is: %d"); getch(); }

c program for mulitiplication,division,addition and subtracting.

Image
Programm for addition,multiplication,subtraction and division :- #include<stdio.h> #include<conio.h> void main() { int a,b,c,d,e,f; clrscr(); printf("enter first numbers= "); scanf("%d",&a); printf("enter second number= "); scanf("%d",&b); c=a+b; printf("the sum of all no. is= %d",c); d=a-b; printf("\nthe subtraction of these no. is= %d",d); e=a*b; printf("\nthe multiplecation of these no.is= %d",e); f=a/b; printf("\nthe division of these no. is= %d",f); getch(); }

c program to find greatest no.

Image
Program to find the greatest no. from two no.  :- #include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); printf("enter any two numbers = \n"); scanf("%d%d",&a,&b); if(a>b) {printf("greater no. is = %d",a);} else if(b>a) {printf("greater no. is = %d",b);} getch(); }

c program to find simple interest

Image
Program to find the simple interest:- #include<stdio.h> #include<conio.h> void main() { int amount,rate,time,principle; clrscr(); printf("enter principle amount = "); scanf("%d",&amount); printf("\nenter rate of interest = "); scanf("%d",&rate); printf("\nenter period of time = "); scanf("%d",&time); principle=(amount*rate*time)/100; printf("\nsimple interest:%d",principle); getch(); }

c programm : grosser salary

Image
c programm  If basic salary is less then rs.1500, then hra=10% of basic salary & da=90% of basic salary . if salary is either equal or above then hra=rs.500 & da=98% of basic salary:- #include<stdio.h> #include<conio.h> void main() { float gross_salary,basic,da,hra; clrscr(); printf("enter the basic salary="); scanf("%f",&basic); if(basic<1500) {da=0.90*basic; hra=0.1*basic; printf("\nhra=%f",hra); printf("\nda=%f",da); } else {da=0.98*basic; hra=500*basic; printf("\nhra=%f",hra); printf("\nda=%f",da); } gross_salary=basic+da+hra; printf("\ngross_salary = %f",gross_salary); getch(); } when salaryvis greater then rs.1500