My first program in cuda

Hi everyone I’m new in cuda
I’m student
PLease I want to write a program that calculate the number pi
I’ve found an euler series
I want to know please How I can put a variable that contain the produt of my thread
Thank you