HTML basic syntax

Bolded text Text goes here Text goes here Italicized text Text goes here Text goes here Underlined text Text goes here Changing font color Text goes here Text goes here Changing font size Text goes here Text goes here Adding links <a href=”http://www.URLgoeshere.com” target=”_blank”>Link goes here o    target=_blank indicates that the link will open in aContinue reading “HTML basic syntax”

Program to convert Decimal to Binary number

#include void binary(int); void main(void) { int number; cout << “Please enter a positive integer: “; cin >> number; if (number < 0) cout << “That is not a positive integer.\n”; else { cout << number << ” converted to binary is: “; binary(number); cout << endl; }} void binary(int number) { int remainder; if(numberContinue reading “Program to convert Decimal to Binary number”

C program to Find all Roots of a Quadratic equation

Source Code to Find Roots of Quadratic Equation /* Program to find roots of a quadratic equation when coefficients are entered by user. *//* Library function sqrt() computes the square root. */#include #include /* This is needed to use sqrt() function.*/int main(){ float a, b, c, determinant, r1,r2, real, imag; printf(“Enter coefficients a, b andContinue reading “C program to Find all Roots of a Quadratic equation”

C Program to Find the Largest Number Among Three Numbers

Source Code 1 /* C program to find largest number using if statement only */#include int main(){ float a, b, c; printf(“Enter three numbers: “); scanf(“%f %f %f”, &a, &b, &c); if(a>=b && a>=c) printf(“Largest number = %.2f”, a); if(b>=a && b>=c) printf(“Largest number = %.2f”, b); if(c>=a && c>=b) printf(“Largest number = %.2f”, c);Continue reading “C Program to Find the Largest Number Among Three Numbers”

C Program to Check Vowel or Consonant

Source Code to Check Whether a Character is Vowel or consonant #include int main(){ char c; printf(“Enter an alphabet: “); scanf(“%c”,&c); if(c==’a’||c==’A’||c==’e’||c==’E’||c==’i’||c==’I’||c==’o’||c==’O’||c==’u’||c==’U’) printf(“%c is a vowel.”,c); else printf(“%c is a consonant.”,c); return 0;} Output 1 Enter an alphabet: ii is a vowel.

C Program to Check Whether a Number is Even or Odd

Source Code to Check Whether a Number is Even or Odd /*C program to check whether a number entered by user is even or odd. */#include int main(){ int num; printf(“Enter an integer you want to check: “); scanf(“%d”,&num); if((num%2)==0) /* Checking whether remainder is 0 or not. */ printf(“%d is even.”,num); else printf(“%d isContinue reading “C Program to Check Whether a Number is Even or Odd”

C Program to Find Quotient and Remainder of Two Integers Entered by User

Source Code /* C Program to compute remainder and quotient */#include int main(){ int dividend, divisor, quotient, remainder; printf(“Enter dividend: “); scanf(“%d”,&dividend); printf(“Enter divisor: “); scanf(“%d”,&divisor); quotient=dividend/divisor; /* Computes quotient */ remainder=dividend%divisor; /* Computes remainder */ printf(“Quotient = %d\n”,quotient); printf(“Remainder = %d”,remainder); return 0;} Output Enter dividend: 25Enter divisor: 4Quotient = 6Remainder = 1

C Program to Multiply two Floating Point Numbers

Source Code /*C program to multiply and display the product of two floating point numbers entered by user. */#include int main( ){ float num1, num2, product; printf(“Enter two numbers: “); scanf(“%f %f”,&num1,&num2); /* Stores the two floating point numbers entered by user in variable num1 and num2 respectively */ product=num1*num2; /* Performs multiplication and storesContinue reading “C Program to Multiply two Floating Point Numbers”