Control flow
Control flow
#include <stdio.h>
int main() {
int a = 11, b = 2, c = 9;
return 0;
}
#include <stdio.h>
void checkNum(int N) {
int main() {
int N = 10;
checkNum(N);
return 0;
}
int main()
{
char ch = 'A';
return 0;
}
(4) Check whether an integer is odd or even
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
return 0;
}
(5) Find the roots of the quadratic equation
#include <math.h>
#include <stdio.h>
int main() {
double a, b, c, discriminant, root1, root2, realPart, imagPart;
printf("Enter coefficients a, b and c: ");
scanf("%lf %lf %lf", &a, &b, &c);
discriminant = b * b - 4 * a * c;
return 0;
}