Skip to content

Instantly share code, notes, and snippets.

View Svastikkka's full-sized avatar
🏛️
Working from Gift City

Manshu Sharma Svastikkka

🏛️
Working from Gift City
View GitHub Profile
@Svastikkka
Svastikkka / Ellipse.c
Last active November 18, 2018 01:48
Computer Graphics sample projects written in c using OpenGl
/*
*this program is design by manshu sharma as help to other students you can copy this and display as your project
*step1 :- int rx=80, ry=20, xc=0, yc=ry;// radius x ,radius y center of x = 0 center of y = radius of y
*step2 :- float p=(ry*ry)-(rx*rx*ry)+((0.25)*(rx*rx));
*step3 :- apply a while loop with condition (2*ry*ry*xc)<=(2*rx*rx*yc)
*step4 :- In that while loop apply two conditions p<0
*step5 :- while((2*ry*ry*xc)<=(2*rx*rx*yc)){
* if(p<0){
* xc++;
* p=p+(2*ry*ry*xc)+(3*ry*ry);
/*
*version 1.0
*/
#include <GL/glut.h>
#include <math.h>
#include <GL/gl.h>
void init(){
glClearColor(0.0,0.0,0.0,0.0);
glMatrixMode(GL_PROJECTION);
import math
num=int(input())
print(int(math.sqrt(num)))
"""
Alorithm way
"""
def decimalToBinary(num):
if num>1:
decimalToBinary(num//2)
print(num%2,end="")
pass
from pip._vendor.distlib.compat import raw_input
num=input() #101010101
print(int(num,2))
n, k = raw_input().split(" ")
n = int(n)
k = int(k)
def reverse(n):
#Implement Your Code Here
n=str(n)
print(int("".join(reversed(n))))
n=int(input())
result = reverse(n)
num=int(input())
count=1
arr=[]
while len(arr)<num:
res=3*count+2
if res%4!=0:
arr.append(res)
count=count+1
for i in range(0,len(arr)):
num=int(input())
c=int(input())
if c==1:
res=0
for i in range(1,num+1):
res=res+num
num=num-1
print(res)
elif c==2:
num,g=input().split()
hra=(20*int(num)/100)
da=(50*int(num)/100)
allow=0
if g == "B":
allow=allow+1500
elif g == "A":
allow=allow+1700
else:
allow = allow + 1300
num=input()
x=[int(i) for i in num]
e=0
o=0
for i in range(0,len(x)):
if x[i]%2==0:
e=e+x[i]
else:
o=o+x[i]
print(e,o)