B

@burningphoenix

positive and negative

C
2 years ago
#include<stdio.h> #include<stdlib.h> struct node{ int data;/* data */ struct node* link; }; void count_of_negative_data(struct node *head); void count_of_positive_data(struct node *head); int main(){

node count

C
2 years ago
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* link; }; void count_of_nodes(struct node* head);

left rotation

C++
2 years ago
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<int> matchingStrings(vector<string> stringList, vector<string> queries) {

left rotation

C
2 years ago
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &);

rotatting cube

C
2 years ago
#include <math.h> #include <stdio.h> #include <string.h> #include <unistd.h> float A, B, C; float cubeWidth = 20; int width = 160, height = 44; float zBuffer[160 * 44];

Max Hourglass Sum.

C++
2 years ago
#include <bits/stdc++.h> using namespace std; /* * The function is expected to return an INTEGER. * The function accepts 2D_INTEGER_ARRAY arr as parameter. */ int hourglassSum(vector<vector<int>> arr) { int maxSum = INT_MIN; // Initialize maxSum to a very small value

converting Farenheit to Celcius

C
2 years ago
#include <stdio.h> float c, f, s, d; int main() { printf("Enter the temperature in Fahrenheit: "); scanf("%f", &f); d = f - 32; s = 5.0 / 9.0;

Write a C program to enter any number and calculate its square root.

C
2 years ago
#include <stdio.h> #include<math.h> float number,square_root; int main() { printf("enter number whose square root has to be found"); scanf("%f",&number); square_root = sqrt(number); printf("\nsquare root of %f if %f",number,square_root); return 0; }

Write a C program to enter two angles of a triangle and find the third angle.

C
2 years ago
#include <stdio.h> float angle1, angle2, angle3; int main() { printf("enter the angle1 of triangle"); scanf("%f",&angle1); printf("\nenter the angle2 of triangle"); scanf("%f",&angle2); angle3 = (180-(angle1+angle2)); printf("\nthird angle is %f",angle3);

Write a C program to enter base and height of a triangle and find its area

C
2 years ago
#include <stdio.h> float base, height, area; int main() { printf("enter the length of base = "); scanf("%f",&base); printf("\nenter the length of height = "); scanf("%f",&height); area = (base*height)/2; printf("\narea of triangle with base %f and height %f is = %f",base,height,area); return 0;

Write a C program to calculate area of an equilateral triangle.

C
2 years ago
#include <stdio.h> #include<math.h> float side,area; int main() { //root(3/4)*a^2 printf("enter the length of side of equlateral triangle = "); scanf("%f",&side); area=((sqrt(3)/4)*side*side); printf("\narea of equlateral triangle = %f",area); return 0;

Write a C program to enter marks of five subjects and calculate total, average and percentage

C
2 years ago
#include <stdio.h> float subject1,subject2,subject3,subject4,subject5,sum, average,percentage; int sum_total; int main() { printf("it oly for five subject"); printf("enter marks of subject1 = "); scanf("%f",&subject1); printf("\nenter marks of subject2 = "); scanf("%f",&subject2); printf("\nenter marks of subject3 = ");

. Write a C program to enter P, T, R and calculate Simple Interest

C
2 years ago
#include <stdio.h> #include <math.h> int main() { int p, t, n; float r, Simple_interest; printf("Enter P (initial principal balance): \n"); scanf("%d", &p);

Write a C program to enter P, T, R and calculate Compound Interest

C
2 years ago
#include <stdio.h> #include <math.h> int main() { int p, t, n; float r, compound_interest; printf("Enter P (initial principal balance): \n"); scanf("%d", &p);

Write a C program to find maximum between two numbers using conditional operator

C
2 years ago
#include <stdio.h> int a,b; int main() { scanf("%d %d ",&a,&b); if(a>b){ printf("a is grater of two number");

Write a C program to find maximum between three numbers using conditional operator

C
2 years ago
#include <stdio.h> int a,b,c; int main() { scanf("%d %d %d ",&a,&b,&c); if(a>b){ if(a>c){ printf("a is gratest of three number"); }

Write a C program to check whether a number is even or odd using conditional operator

C
2 years ago
#include <stdio.h> int num; int main() { scanf("%d",&num); if(num%2 == 0){ printf("given num is even"); } else{

Write a C program to check whether year is leap year or not using conditional operator.

C
2 years ago
#include <stdio.h> int year; int main() { scanf("%d",&year); if(year%4 == 0){ printf("given year is leap year"); } else{ printf("given year is not a leap year");}

Write a C program to check whether character is an alphabet or not using conditional operator

C
2 years ago
#include <stdio.h> char a; int main() { scanf("%c", &a); int b=(a>='a'&& a<='z')||(a>='A'&& a<='Z'); if(b){ printf("%c is a Alphabet", a);

Write a C program to perform input/output of all basic data types.

C
2 years ago
// Online C compiler to run C program online #include <stdio.h> int a; char b; float c; double d; int main() { // Write C code here scanf("%d \n", &a); scanf("%c \n", &b);