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