Answers for "how to run a program in c"

C
2

can we write a program without main in c

#include<stdio.h>  
#define start main  
void start() 
{  
   printf("Hello, World!!!");  
}
Posted by: Guest on April-25-2020
5

how to write function in c

#include <stdio.h>

// Here is a function declaraction
// It is declared as "int", meaning it returns an integer
/*
	Here are the return types you can use:
    	char,
        double,
        float,
        int,
        void(meaning there is no return type)
*/
int MyAge() {
	return 25;
}

// MAIN FUNCTION
int main(void) {
	// CALLING THE FUNCTION WE MADE
    MyAge();
}
Posted by: Guest on April-11-2020
0

compile c program

$ gcc hello.c
$ ./a.out
Posted by: Guest on October-21-2021

Code answers related to "how to run a program in c"

Code answers related to "C"

Browse Popular Code Answers by Language