0% found this document useful (0 votes)
9 views8 pages

Myfinal 4 Submit

front page

Uploaded by

arahimratul2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

Myfinal 4 Submit

front page

Uploaded by

arahimratul2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Khwaja Yunus Ali University

Assignment

Name of the Department: Computer Science and Engineering

Course Code: CSE 0613 - 1202

Course Title: Structure Programing Language Lab

Assignment No.: 01

Date of Submission: 17/11/2024

Instructor Signature & Date

Submitted by – Submitted to –
Name: MD. Abdur Rahim Ratul Name: Md. Tarequl Islam
ID Number: 06224205101026 Assistant Professor & Head
th
Batch No: 18 Department of CSE
Semester: 1st Year 1st Semester Khwaja Yunus Ali University
Khwaja Yunus Ali University
** BeeCrowd Problem ( 1029 )
Screenshot-
Code –
#include <stdio.h>

int main() {

int t, n, i;

int fib[41], calls[41] , count=1;

fib[0] = 0;

fib[1] = 1;

calls[0] = 0;

calls[1] = 0;

for (i = 2; i <= 40; i++)

fib[i] = fib[i - 1] + fib[i - 2];

calls[i] = calls[i - 1] + calls[i - 2] + 2;

scanf("%d", &t);

while(count<=t)
{

scanf("%d", &n);

printf("fib(%d) = %d calls = %d\n", n, calls[n], fib[n]);

count++;

return 0;

}
** BeeCrowd Problem ( 1176 )

Screenshot –
Code—
#include <stdio.h>

int main()

long long int n, count = 1, a, i;

scanf("%lld", &n);

while (count <= n)

scanf("%lld", &a);

if (a == 0)

printf("Fib(%lld) = 0\n", a);

else

long long int num[a + 1];

num[0] = 0;

num[1] = 1;

for (i = 2; i <= a; i++)

num[i] = num[i - 1] + num[i - 2];

printf("Fib(%lld) = %lld\n", a, num[a]);

count++;
}

return 0;

Write a c program to check a string is palindrome or not


**

without using library function .

Code—
#include<stdio.h>

#include<string.h>

int main() {

char strin[100] , str2[100] ;

int length = 0 , flag = 0;

printf("Enter a string : ");

gets(strin);

for (int i=0 ; strin[i] != '\0';i++)

length++ ;

for(int i = 0 , j=length-1 ; j>= 0 ; i++ ,j-- )

str2[i]= strin[j] ;

}
for(int i=0 ; i<length ; i++)

if(strin[i]!=str2[i])

flag=1 ;

break ;

if(flag)

printf("\"%s\" , This word is not a palindrome word .\n", strin);

else{

printf("\"%s\" , This word is a palindrome word .\n", strin);

return 0;

E N D

Thank You

You might also like