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

0 comments:

Post a Comment

 

About Me

It's Me!Hi, I'm Moinuddin. I'm a Software Engineer at WIPRO working on Microsoft .NET Technology. I'm interested in a wide range of technology topics, mainly Microsoft including Windows Azure, WCF, WPF, Silverlight and any other cool technology that catches the eye.

Site Info

ProjectCSharp.com is mainly about demonstrating real time examples in different technologies like ASP.NET, WCF, WPF, Silverlight, Azure etc..,

Followers

Help Links

Project CSharp (C#) Copyright © 2011. All Rights Reserved.