User Tools

Site Tools


tanszek:oktatas:szamitastechnika:vektorok_peldak

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tanszek:oktatas:szamitastechnika:vektorok_peldak [2023/11/29 07:26] kneheztanszek:oktatas:szamitastechnika:vektorok_peldak [2023/11/29 08:05] (current) knehez
Line 86: Line 86:
  
 <sxh c> <sxh c>
-    #include <stdio.h> +#include <stdio.h> 
-    int main()+int main() 
 +
 +    float vektor[ ] = {1.2, 2.3, 3.4, 4.5, 5.5, 6.7, 4.5, 0.4}; 
 +    float szumma = 0, *v = vektor; 
 +     
 +    int elemszam = sizeof(vektor) / sizeof(float); 
 +     
 +    do 
     {     {
-        float vektor[ ] = {1.2, 2.3, 3.4, 4.5, 5.5, 6.7, 4.5, 0.4}; +        szumma += *v; 
-        float szumma = 0, *v = vektor; +    }   
-         +    while(++v != &vektor[elemszam]); 
-        do  +          
-        { +    printf("Szumma= %f", szumma); 
-            szumma += *v; +}
-        }   +
-        while(++v != &vektor[sizeof(vektor)/sizeof(float)]); +
-         +
-        printf("Szumma= %f", szumma); +
-    }+
 </sxh> </sxh>
  
  
  
tanszek/oktatas/szamitastechnika/vektorok_peldak.1701242800.txt.gz · Last modified: 2023/11/29 07:26 by knehez