How to write c program
Hello
how to write c program in computer...... for adding two number... |
ask teacher
|
Quote:
|
We will not do your homework.
Code:
man printf If you want to learn programming buy yourself a copy of Kernighan & Ritchie or go here. FIRST study, THEN try, FINALLY ask questions. |
1.
Code:
#include <stdio.h> Code:
#include <stdio.h> Code:
gcc -Wall MyReallyCoolAndGrooveyAddsTwoNumbersProgram.c as @Delcaran stated, if this is homework, then I'd think the teacher would have covered on how to do this. The basics behind it anyways. |
Moderator response
Moved: This thread is more suitable in <Programming > and has been moved accordingly to help your thread/question get the exposure it deserves.
|
When you copy and paste code from somewhere, you need to link to the source.
https://www.programmingsimplified.co...dd-two-numbers |
As this all is completely useless, of course, here a c++ variant:
Code:
#include <iostream> |
Quote:
Most of those are print format string modifiers. The &a is the address of the variable "a" which you are giving to the scanf() function. Sounds like you need to start with a hello world example, and get a full + complete description of every aspect of it before you try more complex examples. Read this tutorial, https://www.codingunit.com/c-tutoria...am-hello-world it explains every aspect of each line and character in the hello world example. |
All times are GMT -5. The time now is 05:01 AM. |