All questions
- What is logical variable? Logical Variables are simply placeholders for values which are not yet known, like in mathematics 1
- What is main difference between variable and constant? A constant does not change its value over time. A variable, on the other hand, changes its value dependent on the equation. 1
- How many bytes are required to store double type value? . 8 bytes 2
- How many bytes are required to store char type value? Answer: 1 byte (8 bits). A char stores a single character. The C standard defines sizeof(char) as exactly 1 on every compiler. Internally th... 1
- How many bytes are required to store float type value? Answer: 4 bytes (32 bits). A float stores single-precision real numbers. On practically every C compiler (Turbo C, GCC, Visual C++) it takes... 1
- How many bytes are required to store integer type value? Answer: it depends on the compiler: 2 bytes in 16-bit compilers such as Turbo C, and 4 bytes in modern 32-bit/64-bit compilers such as GCC a... 1
- What is constant? in c Answer: a constant in C is a fixed value that cannot be changed while the program runs. Types of constants (literals): Integer constants: 10... 1
- What is variable? in c A variable is a name of the memory location. It is used to store data. Its value can be changed, and it can be reused many times. 1
- Python Program to Find the Largest Among Three Numbers num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) num3 = float(input("Enter third number: ")) if (num... 1
- Python Program to Check Leap Year year = int(input("Enter a year: ")) # divided by 100 means century year (ending with 00) # century year divided by 400 is leap year if (year... 1
- Python Program to Check if a Number is Odd or Even num = int(input("Enter a number: ")) if (num % 2) == 0: print("{0} is Even".format(num)) else: print("{0} is Odd".format(num)) 1
- Python Program to Check if a Number is Positive, Negative or 0 num = float(input("Enter a number: ")) if num > 0: print("Positive number") elif num == 0: print("Zero") else: print("Negative number") 1
- Python Program to Convert Celsius To Fahrenheit celsius = 37.5 # calculate fahrenheit fahrenheit = (celsius * 1.8) + 32 print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(c... 1
- Python Program to Convert Kilometers to Miles # Taking kilometers input from the user kilometers = float(input("Enter value in kilometers: ")) # conversion factor conv_fac = 0.621371 # c... 1
- Python Program to Generate a Random Number # Program to generate a random number between 0 and 9 # importing the random module import random print(random.randint(0,9)) 1
- Python Program to Swap Two Variables x = input('Enter value of x: ') y = input('Enter value of y: ') # create a temporary variable and swap the values temp = x x = y y = temp pr... 1
- Python Program to Solve Quadratic Equation import cmath a = 1 b = 5 c = 6 # calculate the discriminant d = (b**2) - (4*a*c) # find two solutions sol1 = (-b-cmath.sqrt(d))/(2*a) sol2 =... 1
- Python Program to Calculate the Area of a Triangle a = float(input('Enter first side: ')) b = float(input('Enter second side: ')) c = float(input('Enter third side: ')) s = (a + b + c) / 2 ar... 1
- Python Program to Find the Square Root num = float(input('Enter a number: ')) num_sqrt = num ** 0.5 print('The square root of %0.3f is %0.3f'%(num ,num_sqrt)) 1
- Python Program to Add Two Numbers num1 = 1.5 num2 = 6.3 sum = num1 + num2 print('The sum of {0} and {1} is {2}'.format(num1, num2, sum)) 1
- Python Program to Print Hello world! print('Hello, world!') 2
- Distinguish between Electrolytic cell and Voltaic Cell Answer: An electrolytic cell uses electrical energy to bring about a non-spontaneous chemical reaction, whereas a voltaic (galvanic) cell pr... 2
- Q1) Define a) corrosion b) electrode potential c) electrochemical cell d) wavelength e) electroplating Answer: Definitions of corrosion, electrode potential, electrochemical cell, wavelength and electroplating are given below. a) Corrosion: De... 2
- Write a program to find the largest of n numbers taken from user, using a function the array of numbers must #include<stdio.h> #include<conio.h> void main() { int n,i,a[100],large; int largest (int a[], int n); clrscr(); printf("Enter the number of... 1