C Programming Class 11
C Programming Class 11
C Programming Class 11
1: /*First C program*/
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
Output:
Hello, world!
int main() {
int a = 6, b = 8;
printf("Addition = %d\n", a + b);
printf("Subtraction = %d\n", a - b);
printf("Multiplication = %d\n", a * b);
printf("Quotient = %d\n", a / b);
printf("Remainder = %d\n", a % b);
return 0;
}
Output:
Addition = 14
Subtraction = -2
Multiplication = 48
Quotient = 0
Remainder = 6
1
3. /* program to take user input and print it */
#include <stdio.h>
int main() {
int number;
Output:
Enter an integer: 56
You entered: 56
#include <stdio.h>
int main() {
int a = 3, b = 5, c = 9;
printf("and logical operator= %d\n", a > b && a > c);
printf("or logical operator= %d\n", a > b || a > c);
printf("not logical operator= %d\n", !(a > c));
return 0;
}
Output:
2
5./*Program to display ASCII value of a character */
#include <stdio.h>
int main() {
char c;
printf("Enter a character: ");
scanf("%c", &c);
return 0;
}
Output:
Enter a character: G
ASCII value of G = 71
#include <stdio.h>
int main() {
return 0;
}
Output:
Age: 25
3
7. /*Program to Find the Size of int, float, double and char */
#include<stdio.h>
int main() {
int intType;
float floatType;
double doubleType;
char charType;
return 0;
}
Output: