Professional Documents
Culture Documents
h>
#include "stdafx.h"
#include <iostream>
const int MAX = 100;
using namespace std;
int main()
{
int a[MAX];
int n, m,j=0;
printf("Ucitaj n,m\n");
scanf("%d%d", &n, &m);
for (int i = n; i <= m; i++)
{
if (i % 2 == 0)
{
a[j] = i;
j++;
}
}
for (int i = 0; i <= j-1; i++)
printf("a[%d]=%d\n", i, a[i]);
printf("Broj clanova izmedju 10 i 20 je %d\n", broj(a,j));
system("PAUSE");
return 0;
system("PAUSE");
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main() {
char s1[20], s2[10] ,s3[30];
int br=0;
char n= 'A';
cout << "Ucitaj niz od 20 znakova: \n";
//cin >> s1;
cin.getline(s1, 20);
strcpy(s2, s1);
for (int i = 1; i < strlen(s2); i++)
{
if (s2[i] == 'A')
{
br = br + 1;
}
}
cout << "String s1 je: " << s1 << "String s2 je: " << s2 << "\n";
cout << "S3---Ucitaj niz od 20 znakova:/n ";
cin >> s3;
cout << "String s3 je:\n " << s3;
//cout << "\n";
cout << "broj elemenata je " << br<< endl;
//gets(name_surname);
//cout << "Your name is " << name_surname << "and your age is " <<
"========age";
system("PAUSE");
return 0;
system("PAUSE");
}