Malil Developers
вот немного кода, пожалуйста, используйте dev c++
#include <stdio.h> /* thease all file .h are header files*/
#include <string.h>
#include <conio.h>
#include <windows.h>
#include <math.h>
#include <limits.h>
#include <float.h>
int add() /*function for add*/
{
int a,b,c; /* declerr variable*/
printf("For find addition \n");
printf("Enter Ist Number \n");
scanf("%d",&a);
printf("Enter 2nd Number \n");
scanf("%d",&b);
c=a+b;
printf("Sum of %d and %d is %d",a,b,c);
return 0;
}
int sub() /*function for substraction*/
{
int a,b,c; /* declerr variable*/
printf("For find substraction \n");
printf("Enter Ist Number \n");
scanf("%d",&a);
printf("Enter 2nd Number \n");
scanf("%d",&b);
c=a-b;
printf("Subtraction of %d from %d is %d",a,b,c);
return 0;
}
int multiply() /*function for multiply*/
{
int a,b,c; /* declerr variable*/
printf("For find multiply \n");
printf("Enter Ist Number \n");
scanf("%d",&a);
printf("Enter 2nd Number \n");
scanf("%d",&b);
c=a*b;
printf("%d Multiply %d is %d",a,b,c);
return 0;
}
int divide() /*function for division*/
{
int a,b; /* declerr variable*/
float c; /* declerr variable*/
printf("For find divide \n");
printf("Enter Ist Number \n");
scanf("%d",&a);
printf("Enter 2nd Number \n");
scanf("%d",&b);
c=a/b;
printf("Division of %d/%d is %f",a,b,c);
return 0;
}
int Avg() /*function for average*/
{
int a; /* declerr variable*/
int atotal= 0;
int number = 0;
printf("For find average \n");
printf("Enter Ist Number or enter -1 to find answer\n",a);
scanf("%d",&a);
while(a != -1){ //this is a while loop //
atotal =atotal+ a;
number++;
printf("Enter next number enter -1 to find answer \n");
scanf("%d",&a);
}
printf("Number of average %d \n",number);
printf("Average is %d",atotal/number);
return 0;
}
int remainder () /*function for remainder*/
{
int a,b; /* declerr variable*/
float c; /* declerr variable*/
printf("For find remainder \n");
printf("Enter Ist Number \n");
scanf("%d",&a);
printf("Enter 2nd Number \n");
scanf("%d",&b);
c=a%b;
printf("Remainder of %d between %d is %f",a,b,c);
return 0;
}
int squareroot() /*function for square root*/
{
float sq; /* declerr variable*/
printf("For find square root \n");
printf("Enter any number find square root\n");
scanf("%f",&sq);
printf("Square Root is %f",sqrt(sq));
return 0;
}
int percentage() /*function for percentage*/
{
float a,b,c; /* declerr variable*/
printf("For find percentage \n");
printf("Enter obtained number \n");
scanf("%f",&a);
printf("Enter total number \n");
scanf("%f",&b);
c=a/b*100;
printf("Percantage of %f and %f is %f ",a,b,c);
}
int vowel()
{
char v;
printf("Enter character \n");
scanf("%c",&v);
switch(v){
case 'A':
case 'a':
case 'E':
case 'e':
case 'I':
case 'i':
case 'O':
case 'o':
case 'U':
case 'u':
printf("%c is VOWEL",v);
break;
default:
printf("%c is CONSONANT",v);
}
return 0;
}
int Upperandlowercase(){
char u;
printf("Please enter character");
scanf("%c",&u);
switch(u){
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
printf("%c is Lower Case Character",u);
break;
default:
printf("%c is Upper Case Character",u);
}
return 0;
}
int About()
{
printf("This caluclator is created by malik developers malik umer farooq \n");
printf("Please visit My Website 'http://anythingworld.wix.com/orange' \n");
printf("Thanks for using my software pleae remaind me on your prayer \n");
return 0;
}
int main () /*main function*/
{
char a,x; /* declerr variable*/
do{ /*do while loop*/
system("color 3A"); /*change color*/
printf(" This is a simple calculator that is created by malik umer farooq \n");
printf(" ******************************************************************** \n");
printf(" Version 36.0.5 \n");
printf(" :::::::::::::::::: \n");
printf(" Thanks for using my software \n");
printf(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
printf(" WELCOME TO MALIK DEVELOPEMENT SOFTWAR \n");
printf(" |||||||||||||||||||||||||||||||||||||||||| \n");
printf("Press 'a' for Addition \n");
printf("Press 's' for Subtraction \n");
printf("Press 'm' for Multiplication \n");
printf("Press 'd' for Division \n");
printf("Press 'v' for Average \n");
printf("Press 'e' for Remainder between two number \n");
printf("Press 'h' for Find square root of any number \n");
printf("Press 'p' for Percentage \n");
printf("Press 'c' for VOWEL and CONSONANT \n");
printf("Press 'u' for checking character is upper or lower case \n");
printf("Press 'z' for About \n");
a=getch();
system("cls"); /*clear the screen*/
if(a=='a') /*for loop*/
{
system("color A1");
add();
}
else if(a=='s')
{
system("color B2");
sub();
}
else if(a=='m')
{
system("color E3");
multiply();
}
else if(a=='d')
{
system("color F4");
divide();
}
else if(a=='v')
{
system("color 0A");
Avg();
}
else if(a=='e'){
system("color 1B");
remainder();
}
else if(a=='h')
{
system("color 6D");
squareroot();
}
else if (a=='p'){
system("color 5D");
percentage();
}
else if(a=='c'){
system("color 6F");
vowel();
}
else if(a=='u'){
system("color B4");
Upperandlowercase();
}
else if(a=='z'){
system("color 5E");
About();
}
else /*if else statement*/
{
system("color 8A");
printf("Sorry you press wrong key \n");
}
getch();
printf("\n Press r to repeat \n ");
x=getch();
system("cls");
} //end of do while loop//
while(x=='r');
}</float.h></limits.h></math.h></windows.h></conio.h></string.h></stdio.h>