Skip to content

Instantly share code, notes, and snippets.

View sachinsaxena25's full-sized avatar

sachinsaxena25

View GitHub Profile
#include<stdio.h>
int main(void){
int a = 0;
float b = 0.0f;
double c = 0.0;
long double d = 0.0;
printf("please enter the first number:\n");
scanf("%d", &a);
printf("please enter the second number:\n");
scanf("%f", &b);
#include<stdio.h>
int main(void){
float a = 0.0f;
float b = 0.0f;
float c = 0.0f;
printf("please enter the first number:\n");
scanf("%f", &a);
printf("please enter the second number:\n");
scanf("%f", &b);
c = a / b;
#include<stdio.h>
int main(void){
float a = 0.0f;
float b = 0.0f;
float c = 0.0f;
printf("please enter the first number:\n");
scanf("%f", &a);
printf("please enter the second number:\n");
scanf("%f", &b);
c = a * b;
#include<stdio.h>
int main(void){
float a = 0.0f;
float b = 0.0f;
float c = 0.0f;
printf("please enter the first number:\n");
scanf("%f", &a);
printf("please enter the second number:\n");
scanf("%f", &b);
c = a - b;
#include<stdio.h>
int main(void){
float a = 0.0f;
float b = 0.0f;
float c = 0.0f;
printf("please enter the first number:\n");
scanf("%f", &a);
printf("please enter the second number:\n");
scanf("%f", &b);
c = a + b;
#include<stdio.h>
int main(void){
int a = 0;
int b = 0;
int c = 0;
printf("please enter the number:\n");
scanf("%d", &a);
printf("please enter the number:\n");
scanf("%d", &b);
c = a > b ? a : b;
#include<stdio.h>
int main(void){
int x1 = 0;
int x2 = 0;
printf("please enter the first number:\n");
scanf("%d", &x1);
printf("please enter the second number:\n");
scanf("%d", &x2);
printf("The numbers before swapping are x1 = %d x2 = %d", x1, x2);
x1 = x1 + x2;
#include<stdio.h>
int main(void){
int a = 0;
int b = 0;
int c = 0;
printf("please enter the first number: \n");
scanf("%d", &a);
printf("please enter the second number: \n");
scanf("%d", &b);
printf("The numbers before swapping are a = %d b = %d", a, b);
#include<stdio.h>
int main(void){
int inputNumber = 0;
printf("please enter number:");
scanf("%d", &inputNumber);
(inputNumber % 2 == 0) ? printf("number is even", inputNumber) : printf("number is odd", inputNumber);
return 0;
}
#include<stdio.h>
int main(void){
int a = 0;
int b = 0;
int c = 0;
printf("please enter the value of a:\n");
scanf("%d", &a);
printf("please enter the value of b:\n");
scanf("%d", &b);
printf("please enter the value of c:\n");