Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C Compiler.
- Code, Compile, Run and Debug C program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <stdio.h>
- int main()
- {
- printf("Hello World\n");
- int num1,num2,num3; // i ready to store 3 number, they are integer, so i pick int
- float numSum; // i ready to do addition, i must store decimals, so i pick float
- printf("Give me a number : "); // give me 1st number
- scanf("%d", &num1);//i will accept using scanf %d
- printf("Give me a number : "); // give me 2nd number
- scanf("%d", &num2);//i will accept using scanf %d
- printf("Give me a number : "); // give me 3rd number
- scanf("%d", &num3);//i will accept using scanf %d
- printf("See see har my numbers %d %d %d\n", num1, num2, num3);
- numSum=num1+num2+num3; // now i have 3 number, i do addition ler, add all integers and store into float
- printf("See see har my sum of %d+%d+%d=%.2f\n", num1, num2, num3,numSum); // format my flot
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement