A

@adarshb2005

Write a c program for Taylor series of log

C
2 years ago
#include <stdio.h> #include <math.h> double ln_taylor_series(double x, int n) { if (x <= -1) { printf("Natural logarithm is not defined for x <= -1.\n"); return -1; } double result = 0.0;

Write a c program for Taylor series of sine

C
2 years ago
#include <stdio.h> #include <math.h> double sine(double x, int n) { double result = x; double term = x; int sign = -1; int denominator = 3; for (int i = 1; i < n; i++) {

Write a c program for Taylor series of cosine

C
2 years ago
#include <stdio.h> #include <math.h> double cosine(double x, int n) { double result = 1.0; double term = 1.0; int sign = -1; for (int i = 2; i <= n; i += 2) { term *= (x * x) / (i * (i - 1));

Write a C program to generate the pattern shown in below 5 545 54345 5432345 543212345 5432345 54345

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { // Print decreasing numbers from 5 to i

Write a C program to generate the pattern shown in below 1 121 12321 1234321 123454321 1234321 12321

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { printf("%d", j);

Write a C program to generate the pattern shown in below 12345 1234 123 12 1

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = n; i >= 1; i--) { for (int j = 1; j <= i; j++) {

Write a C program to generate the pattern shown in below 54321 4321 321 21 1

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = n; i >= 1; i--) { for (int j = i; j >= 1; j--) {

Write a C program to generate the pattern shown in below 1 21 321 4321 54321

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { for (int j = i; j >= 1; j--) {

Write a C program to generate the pattern shown in below 1 2 3 3 4 5 6 7 8 9 10 11 12 13 14 15

C
2 years ago
#include <stdio.h> int main() { int n, num = 1; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) {

Write a C program to generate the pattern shown in below 1 12 123 1234 12345

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) {

Write a C program to generate the pattern shown in below 1 22 333 4444 55555

C
2 years ago
#include <stdio.h> int main() { int n; printf("Enter the number of rows: "); scanf("%d", &n); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) {

Write a C program to generate multiplication table for given number

C
2 years ago
#include <stdio.h> int main() { int num, start, end; printf("Enter a number: "); scanf("%d", &num); printf("Enter the start of the range: "); scanf("%d", &start); printf("Enter the end of the range: ");

C Program to Find Sum of All Even Numbers Between 1 to N

C
2 years ago
#include <stdio.h> int main() { int N, sum = 0; printf("Enter the value of N: "); scanf("%d", &N); for (int i = 1; i <= N; i++) { if (i % 2 == 0) { // If it's even, add it to the sum sum += i;

C Program to Find Sum of All Odd Numbers Between 1 to N

C
2 years ago
#include <stdio.h> int main() { int N, sum = 0; printf("Enter the value of N: "); scanf("%d", &N); for (int i = 1; i <= N; i++) { // Check if the number is odd if (i % 2 != 0) { // If it's odd, add it to the sum

Print number continuously from 1 to 100 except 25,50 and 75.

C
2 years ago
#include <stdio.h> int main() { for (int i = 1; i <= 100; i++) { if (i != 25 && i != 50 && i != 75) { printf("%d ", i); } } return 0;

Get integer input from user and print it continuously until the user gives a negative number

C
2 years ago
#include <stdio.h> int main() { int input; while (1) { printf("Enter an integer (negative number to exit): "); scanf("%d", &input); if (input < 0) {

Write a program to print 5 * 5 box.

C
2 years ago
#include <stdio.h> int main() { int rows = 5; int columns = 5; for (int i = 1; i <= rows; i++) { for (int j = 1; j <= columns; j++) { // Print '*' for each position printf("* ");

Get input from the user and print it until the input is 100

C
2 years ago
#include <stdio.h> int main() { int input; while (1) { printf("Enter a number: "); scanf("%d", &input); if (input == 100) {

Get an integer input from user and print how many times it can be divided by 2 till it becomes 1

C
2 years ago
#include <stdio.h> int main() { int num, count = 0; printf("Enter an integer: "); scanf("%d", &num); if (num <= 0) { printf("Please enter a positive integer.\n");

Program to add two integers using do-while loop

C
2 years ago
#include <stdio.h> int main() { int num1, num2, sum; printf("Enter the first integer: "); scanf("%d", &num1); printf("Enter the second integer: "); scanf("%d", &num2);