Showing posts with label Printf. Show all posts
Showing posts with label Printf. Show all posts

Thursday, October 20, 2011

#1 Povrsina pravouglog trougla

#include<conio.h>
#include<stdio.h>

 int a,b;
 double povrsina;
 main(){
 
  printf("Program za racunanje pov pravouglog trougla \n");
       
        printf("Molim vas unesite stranice a i b\n");
       
        printf("a="); scanf("%d",&a);
        printf("b="); scanf("%d",&b);
   
       
        printf("**** Povrsina je ***\n\n");
        povrsina=float(a*b)/2.0;
        printf("Povrsina=%f \n\n",povrsina);  
       
 getch();      
 }

Friday, September 17, 2010

#1 Računanje obima kruga uz pomoć konstante Pi

#include <stdio.h>
#include <conio.h>

#define PI 3.145

        main(){
              
        int r=5; //cm
        float obim;
        obim=2*r*PI;
        printf("obim=%f cm",obim);      
          getch();    
              
        }

Wednesday, September 15, 2010

#1 Hello World u C programskom jeziku

#include <stdio.h>
#include <conio.h>

void main(){

    printf("Hello World \n");
    getch();


}