[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] C prog efter # c: Linux - Friheden til at programmere i C



On Wednesday 28 May 2003 17.09, Mark Larsen wrote:
> Hej alle
>
> Ha rigennem længer tid spekuleret over at starte med at programmere lidt
> igen - så jeg satte mig for, at prøve den indbyggede c i Mnadrake 9.1
>
> Version:
> gcc (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
>
> Men allerede i et af de første eksempler render jeg ind i et problem
>
> Koden er
>
> #include <stdio.h>  // Stream declarations
>
> int main()
> {
>          int procent = 17;
>          int kroner = 100;
>          int resultat;
>
>          resultat = procent*kroner / 100

Här ska vara ett semikolon
	resultat = procent*kroner/100;

>
>          puts("resultat er", resultat);

puts() tar bara ett argument, en sträng som ska skrivas ut. Pröva

	printf("resultat er %d\n", resultat);

%d betyder "här ska vara ett heltal", och \n betyder radbrytning

>
>          return 0

semikolon här också

	return 0;

> }



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *