Results 1 to 3 of 3
Thread: :)
Hybrid View
-
17th September 2016 21:36 #1Registered User
Join Date: Apr:2008
Location: 25
Posts: 1
:)
.
20 ?
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h>
int main()
{
int a[11];
int i, suma, pro;
printf("vavedete stoinosta na masiva : \n");
for (i = 1; i <= 11; i++);
{
printf_s("a[%d]", i);
scanf_s("%d", &a[i]);
}
suma = 0;
pro = 1;
for (i = 1; i <= 11; i++);
{suma += a[i];
pro = pro*a[i];
}
printf("sumata e : %d", suma);
printf("pro e : %d", pro);
return 0;
}
-
17th September 2016 22:19 #2Banned
Join Date: Mar:2008
Location: ( ͡ ͜ʖ ͡)
Posts: 10,614
? ?
- - . , [] < , -> , .
-
17th September 2016 23:02 #3
: - ; - 0- ; -, ++.
:
Code:#include <iostream> using namespace std; int main() { const int ArrSize = 20; int arr[ArrSize]; int min = 0; int position = 0; cout << "Enter 20 array elements.\n"; for(int i = 0; i < ArrSize; i++) { cin >> arr[i]; } min = arr[0]; for(int i = 1; i < ArrSize; i++) { if(arr[i] < min) { min = arr[i]; position = i + 1; } } cout << "Minimum element is: " << min << ".\n"; cout << "The position is: " << position << ".\n"; return 0; }Last edited by GringoBG; 17th September 2016 at 23:35.
AMD Ryzen 5 5600x | Noctua NH-D15 | GB B550 Aorus Pro AC | 2x8 GB DDR4 Corsair Corsair Vengeance LPX @ 3200 Mhz | GW 3070 Phoenix GS | Corsair RM850 "Gold" | Seagate Barracuda 500GB | SanDisk SSD Plus 240 GB | ADATA 480 GB | Fractal Design Core 3000 |
Lenovo IdeaPad 510 + Patriot Blast 240GB




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in