Answers for "is number c"

C
0

number in c

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main()
{
	int a, b;
    float c, d;
    scanf("%i %i", &a, &b);
    scanf("%f %f", &c, &d);
    int sum1 = a + b;
    int sum2 = a - b;
    float sum3 = c + d;
    float sum4 = c - d;
    printf("%i %in", sum1, sum2);
    printf("%.1f %.1f", sum3, sum4);
    return 0;
}
Posted by: Guest on April-25-2021
0

how to know a type of a numbe in c

int num;
char term;
if(scanf("%d%c", &num, &term) != 2 || term != 'n')
    printf("failuren");
else
    printf("valid integer followed by enter keyn");
Posted by: Guest on April-02-2021
-2

c check if char is number

char c = 'a'; // or whatever

if (isalpha(c)) {
    puts("it's a letter");
} else if (isdigit(c)) {
    puts("it's a digit");
} else {
    puts("something else?");
}
Posted by: Guest on June-09-2020

Code answers related to "C"

Browse Popular Code Answers by Language