c programing solve presentation -cse

Post on 17-Aug-2015

139 Views

Category:

Engineering

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Daffodil International University

Programming in CPRESENTATION

CSE LAB

Submitted To----------------------------------

Md. Sazzadur Ahamed Problem Solving Lab TeacherDaffodil International University

Group Name :

We Are1. Salman Ahmed 151-15-5418

2. Noban Hasan 151-15-5035

3. MD Manik 151-15-5039

4. Clinton Plasid 151-15-5077

5. Farhan Saifullah 151-15-4791

PS-K Presentation Topic

Write a code which calculate the value of (a+b)3

Write a code as you wish (should be unique, don’t match with others code).

Write a code which calculate the value of (a+b)3

#include<stdio.h> Standard Input Output Header

int main() { int a,b,c; Variable declare

scanf("%d%d" , &a,&b); input the value of a and b

c = (a+b) * (a+b) *(a+b); Calculate the value of (a+b)^3

printf("%d" ,c); Display the Result in Console

return 0; }

Program Code in Code::blocks

Output Screenshort

Our Own Code (Fibonacci Number)

#include<stdio.h>

int main(){ int i,j; while(1==scanf("%d" ,&j)) Input the sequence of fibonacci { int a=0 ,b =1,c; for(i=1;i<=(j-1);i++) Loop { printf("%d " ,a); print the first element of fibonacci seris c=a+b; a= b; assign the value of b in a variable b= c; assign the value of c in b variable } printf("%d\n",a); Print the last value of a; } return 0;}

Program Code in Code::blocks

Output Screenshort

Fibonacci Number

top related