If a structure in the C language has to be initialized through both memory allocation and default field setting, and if these tasks are to be conveniently accomplished inside a function, then describe how the indicated function has to be coded, which input arguments it may accept, and how it may be called in practice.
Write a program that will read an arbitrary number of sets of triangle sides using only integer values.
You need to have functions for the following tasks:
Sample run:
Provide three side lengths – 0 0 0 to terminate.
3
5
4
3 5 4 Triangle possible: Scalene and Right
Write a C++ program to create a calculator for the number by creating a class of numbers overloading all operators in it.
Operators to use in the program are:
++ , -- , + , - , / , * , >> , <<
Write a program in C++ that takes two 4 x 4 matrices as input from the user and displays the matrices in tabular form. Then ask the user to make a choice: 1. Press 1 for matrix addition 2. Press 2 for matrix subtraction 3. Press 3 for matrix multiplication 4. Press 4 for matrix transpose Use 2D arrays to save matrix values and use functions to perform addition, subtraction, multiplication, and transpose.
Write a c sharp program that computes the circumstance and area of a circle. Declare pi as constant with value of 3.1416.
float x = 4.3, y = 9.2;
bool a = false;
1. ((x < 5) && (y < 10))
2. !((x < 5) && (y < 10))
3. ( !(x < 5) || !(y < 10))
4. (x >= 5) || (y >= 10))
5. !((x >= 5) || (y >= 10))
6. ( !(x >= 5) && !(y >= 10))
7. ((x < 5) && (y > 10))
8. ((x < 5) || !(y < 10))
9. !((x >= 5) && (y != 10))
10. !a && !(y >= 10))
EXP CURRENT VALUE OF x
1. x = 36; __________________
2. x += 13; __________________
3. x = x - 23; __________________
4. x -= 32; __________________
5. x++; __________________
6. x -= 2; __________________
7. x--; __________________
8. x = x + 6; __________________
9. x += 17; __________________
10. x -= 4; __________________
Write a function to parse the below pattern onto a text file and highlight the matched pattern using the sliding window concept.
AATAA
ATTAAA
TATA
CAT
ATAGTCGC
Expected output
Sliding window 1: First 32 bases from 2048
TTTATGTGCCCCCCCCCATTTTATTTT
----
Till you get last 32 basesExplain the limitation of PCI bus sharing
String Slicing
Given two strings
inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString. Slice the inputString starting from the subString to the end of the inputString.Input
The first line of input contains a string inputString
The second line of input contains a string subString
Output
The output should be a sliced string or inputString (if the inputString does not include the subString)
Sample Input 1
JavaScript
S
Sample Output 1
Script
Sample Input 2
Language
air
Sample Output 2
Language
"use strict";
function readLine() {
return inputString[currentLine++];
}
function main() {
let inputString = readLine();
const subString = readLine();
/* Write your code here */
console.log(subString.substr(inputString.substr(subString)));
}Write a program using one-dimensional array that searches a number if it is found on the list of the given 5 input numbers and locate its exact location in the list.
Sample input/output dialogue:
Enter a list of numbers: 5 4 8 2 6
Enter a number to be searched: 2 2 found in location 4