hackerearth questions siemens

Solutions on MaxInterview for hackerearth questions siemens by the best coders in the world

showing results for - "hackerearth questions siemens"
Valentina
26 Jun 2018
1#include<stdio.h>
2
3int main()
4{
5    int c[ ]={2.8,3.4,4,6.7,5};
6    int j, *q=c;
7    for(j=0;j<5;j++)
8    {
9        printf("%d ",*c);
10        ++q;
11    }
12    return 0;
13}
Marta
02 Oct 2019
1struct Semaphore
2 { 
3	enum value(0, 1); 
4	Queue q; 
5} 
6P(Semaphore s) 
7{ 
8	if (s.value == 1)
9           { 
10		s.value = 0; 
11	} 
12	else
13           { 
14		q.push(P);
15	            sleep(); 
16	} 
17} 
18V(Semaphore s) 
19{ 
20	if (s.q is empty)
21            { 
22		s.value = 1; 
23	} 
24	else
25           { 
26		q.pop(); 
27		wakeup(); 
28	} 
29} 
30
Enrico
02 Jan 2018
1class company1:
2    cars_manuf = 100
3    def x(self): 
4        company1.cars_manuf = 150
5       
6class company2(company1): 
7    cars_manuf = 1000
8    def x(self): 
9        print(company2.cars_manuf*company1.cars_manuf)
10  
11class company3(company1):
12    def x(self): 
13        cars_manuf = 10
14      
15class Partner(company2, company3): 
16    def x(self): 
17        partner_car_val = company2.cars_manuf/company3.cars_manuf   
18        return partner_car_val
19obj = Partner() 
20a = obj.x()
21print(a)
similar questions
deque problem hacker rank