Write a program to add two numbers.

This program performs addition on two numbers and displays the result.

#include <stdio.h>
main()
{
int number;
float amount;
number = 100;
amount = 30.75 + 75.35;
printf("%d\n", number);
printf("%5.2f", amount);
}


This program when executed will produce following output:

100
106.10

No comments:

Post a Comment