[ create a new paste ] login | about

Link: http://codepad.org/JbyEvk1K    [ raw code | output | fork ]

C, pasted on Aug 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
int schet(int chislo,int chislo2);
int main()
{
    printf("%d",schet(12,8));
    getchar();
    return 0;    
}
int schet(int chislo,int chislo2)
{
    int res=0,temp,i;
    if (chislo%chislo2==0) return chislo;
    if (chislo2%chislo==0) return chislo2;
    for(chislo>chislo2?i=chislo:i=chislo2;;i++)
    {
                                               if (i%chislo==0 && i%chislo2==0) return i;
    }
    return res;
}


Output:
1
2
In function 'schet':
Line 14: error: invalid lvalue in assignment


Create a new paste based on this one


Comments: