0% found this document useful (0 votes)
5 views4 pages

C Programming Bridge Course Notes

Uploaded by

bcnandini017
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

C Programming Bridge Course Notes

Uploaded by

bcnandini017
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Step 1: Start

Step 2: Read a, b
Step 3: a = a + b
Step 4: b = a - b
Step 5: a = a - b
Step 6: Print a, b
Step 7: Stop
#include <stdio.h>
int main() {
// variable declarations
// statements
return 0;
}

#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}

#include <stdio.h>
int main() {
int a, b;
char op;
printf("Enter expression (a op b): ");
scanf("%d %c %d", &a, &op, &b);
switch(op) {
case '+': printf("Result = %d", a + b); break;
case '-': printf("Result = %d", a - b); break;
case '*': printf("Result = %d", a * b); break;
case '/': printf("Result = %d", a / b); break;
case '%': printf("Result = %d", a % b); break;
default: printf("Invalid operator");
}
return 0;
}

int a; scanf("%d", &a); printf("%d", a);

char c; c = getchar(); putchar(c);


int a = 10; float b; b = a; // int automatically converted to float

float x = 5.5; int y; y = (int)x; // float converted to int

You might also like