I have created a "c programming" but am unable to run it.

Asked by Shashi Shekhar Kumar

I am very new for c programming. I have created a simple programming...
#include <stdio.h>
int main()
{
           int p,n;
           float r,si;

           p=1000;
           n=3;
           r=8.5;

           si=p*n*r/100;

           printf("%f\n",si);
           return 0;
}

Now I want to run this but the problem is how ! Please tell me the commands which should be entered .

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu build-essential Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

sudo apt-get install build-essential

if you change:

int main()
to:
void main()

You don't need the return 0; line.

Can you help with this problem?

Provide an answer of your own, or ask Shashi Shekhar Kumar for more information if necessary.

To post a message you must log in.