c programing
768 FOLLOWERS
This blog will help you to get more questions about c programming and also help to who is better and right and also easy for you so you can learn fast.
c programing
4y ago
#include <stdio.h> float add(float num1, float num2); float sub(float num1, float num2); float mult(float num1, float num2); float div(float num1, float num2); int main() { char op; float num1, num2, result=0.0f; printf("WELCOME TO SIMPLE CALCULATOR\n"); printf("----------------------------\n"); printf("Enter [number 1] [+ - * /] [number 2]\n"); scanf("%f %c %f", &num1, &op, &num2); switch(op) { case '+': result = add(num1, num2); break; case '-': result = sub(num1, num2); bre ..read more
c programing
4y ago
#include <stdio.h> int main() { int cp, sp, amt; printf("Enter cost price: "); scanf("%d", &cp); printf("Enter selling price: "); scanf("%d", &sp); if(sp > cp) { amt = sp - cp; printf("Profit = %d", amt); } else if(cp > sp) { amt = cp - sp; printf("Loss = %d", amt); } else { printf("No Profit No Loss."); } return 0 ..read more
c programing
4y ago
------------------------------------------------- number is even or odd
#include <stdio.h> int main() { int num; printf("Enter any number: "); scanf("%d", &num); if(num % 2 == 0) { printf("Number is Even"); } else { printf("Number is Odd"); } return 0; } ----------------------------------------------- check whether a character is alphabet or not ..read more
c programing
4y ago
--------------------------------------------------------- check whether a character is alphabet or not
check alphabets using ASCII value
#include <stdio.h> int main() { char ch; printf("Enter any character: "); scanf("%c", &ch); if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { printf("Character is an ALPHABET."); } else { printf("Character is NOT ALPHABET."); } return 0; } a character is alphabet or not
#include <stdio.h> int main() { char ch; printf("Enter ..read more
c programing
4y ago
---------------------------------------------------------- find Leep year
#include <stdio.h> int main() { int year; printf("Enter year : "); scanf("%d", &year); if(year % 4 == 0) { printf("LEAP YEAR"); } else { printf("COMMON YEAR"); } return 0; } ---------------------------------------------------------- number is even or odd ..read more
c programing
4y ago
divide by one number
#include <stdio.h> int main() { int num; printf("Enter any number: "); scanf("%d", &num); if((num % 5 == 0) { printf("Number is divisible by 5"); } else { printf("Number is not divisible by 5"); } return 0; } ------------------------------------------------------
divide by two number
#include <stdio.h> int main() { int num; printf("Enter any number: "); scanf("%d", &num); if((num % 4 == 0) && (num % 21 == 0)) { printf("Number is divisible by 4 and ..read more
c programing
4y ago
check whether a number is positive, negative or zero#include <stdio.h> int main() { int num; printf("Enter any number: "); scanf("%d", &num); if(num > 0) { printf("Number is POSITIVE"); } if(num < 0) { printf("Number is NEGATIVE"); } if(num == 0) { printf("Number is ZERO"); } return 0; } -------------------------------------------------------------------------------------------- #include <stdio.h> int main(); { int num; printf("Enter any number: "); scanf("%d", num); i ..read more
c programing
4y ago
------------------------------------------------------------------#include <stdio.h> int main() { int num1, num2, num3, max; printf("Enter three numbers: "); scanf("%d%d%d", &num1, &num2, &num3); if(num1 > num2) { if(num1 > num3) { max = num1; } else { max = num3; } } else { if(num2 > num3) { max = num2; } else { max = num3; } } printf("Maximum among all three numbers = %d", max ..read more
c programing
4y ago
The Wall Known Mathed
#include <stdio.h> int main() { int num1, num2; printf("Enter two numbers: "); scanf("%d%d", &num1, &num2); if(num1 > num2) { printf("%d is maximum", num1); } if(num2 > num1) { printf("%d is maximum", num2); } if(num1 == num2) { printf("Both are equal"); } return 0; }
--------------------------------------------------------------------------------
The Esiest Known Mathed
#include <stdio.h>
int main()
{
int num1,num2;
printf("Enter The two number: ");
scanf("%d%d", &num1, &num2);
if(num1 &g ..read more