Sunday, April 12, 2020

Tuesday, April 7, 2020

Monday, April 6, 2020

Thursday, April 2, 2020

c program to check given number is armstrong number or not

C program to check given number is armstrong number or not    A Positive number is called Armstrong number.   abcd.... = an + bn + cn + dn + In this case of Armstrong number of 3 digits, the sum cubes of each digits is equal to the number of itself. 123 = 1*1*1 + 2*2*2...

c program to print reverse of a number using while loop

C program to print reverse of a number using while loop #include int main() { int n, rev = 0, remainder; // Integer values printf("Enter an integer: "); // Enter user value scanf("%d", &n); // storing values while (n != 0) // while loop { remainder = n % 10; ...

c program to check whether a number is palindrome or not using while loop

C program to check whether a number is palindrome or not using while loop An integer is palindrome if the reverse of that number is equal to the original number. #include int main() { int n, reversedN = 0, remainder, originalN; printf("Enter an integer: "); scanf("%d", &n); ...

c program to check whether a character is uppercase or lowercase alphabet

c program to check whether a character is uppercase or lowercase alphabet  #include int main() { char c; // enter character value printf("Enter u to display uppercase alphabets.\n"); // U for uppcase printf("Enter l to display lowercase alphabets. \n"); // I for lowercase ...

c program to display character from a to z using loop

C program to display character from a to z using loop #include int main() { char c; //Character variable for (c = 'A'; c <= 'Z'; ++c) // loop character variable printf("%c ", c); // print final result return 0; } Output A B C D E F G H I J K L M N O P Q R S T U V W X Y...

c program to find lcm of two numbers using while loop

C program to find lcm of two numbers using while loop The LCM of two numbers n1 and n2  is the smallest positive integer that is perfectly divisible by both n1 and n2.  #include int main() { int n1, n2, min; // integer variables printf("Enter two positive integers: "); // Entered...

c program to calculate the gcd of two numbers

C program to calculate the gcd of two numbers The HCF or GCD  of two integers is the largest integer that can exactly divided both numbers. There are many ways to find the greatest common divisor in C program. #include int main() { int n1, n2, i, gcd; // integer variables ...

c program fibonacci sequence upto certain number using while loop algorithm

C program fibonacci sequence upto certain number using while loop algorithm C program #include int main() { int a1 = 0, a2 = 1, nextTerm = 0, n; // integer variables printf("Enter a positive number: "); // user input value scanf("%d", &n); // storing user entered value // displays...

c program to display fibonacci series simple way example

C program to display fibonacci series simple way example  #include int main() { int i, n, t1 = 0, t2 = 1, nextTerm; // integer variables printf("Enter the number of terms: "); // input from user scanf("%d", &n); // storing value entered from suer printf("Fibonacci Series:...

C Program to Find Factorial of a Number

C Program Find Factorial of a Number   The fractional of a positive number n is given. The factorial of n (n!) = 1*2*3*4*5....n The factorial of a negative number doesn't exist.The factorial of 0 is 1. #include int main() { int n, i; // integer values unsigned long long...

C program to sum of all natural number using while loop

C program to Sum of All Natural Number Using While Loop #include int main() { int n, i, sum = 0; // integer value printf("Enter a positive integer: "); // enter user positive number scanf("%d", &n); // storing number i = 1; while (i <= n) // while loop { ...

C program to Sum of all natural number using for loop

C program to Sum of all Natural Number Using for loop  The positive numbers are 1,2,3.............n are known as natural numbers. The sum of natural numbers are upto 10. #include int main() { int n, i, sum = 0; // integer value declaration printf("Enter a positive integer: ");...

C program to check character is vowel or not

 C program to check character is vowel or not Five letter 'A' 'E' 'I' 'O' 'U' are called vowels. All other alphabets excepts these vowels are called consonants. #include int main() { char c; // character value int lowercase, uppercase; // integer value printf("Enter an alphabet:...

Tuesday, March 31, 2020

C Program check number is positive or negative using if else

C Program check number is positive or negative using if else  #include int main() { double num; // constant number printf("Enter a number: "); // enter user scanf("%lf", &num); // storing constant value if (num <= 0.0) // check number is greater or not { if...

C Program to Swap two number without using temporary variable

C program to Swap two Numbers Without Using Temporary Variable #include int main() { double a, b; // initialization constant variables printf("Enter a: "); // user enter number scanf("%lf", &a); // storing value of user number printf("Enter b: "); // user enter number scanf("%lf",...

Monday, March 30, 2020

c program to Find ASCII Value of a Character

C Program to Find ASCII Value of a Character In C programing, a Character variables holds ASCII value (an integer number between 0 to 127) rather than that character itself. That value is known as it's ASCII value. For example, the ASCII value of  'A' is 65. What this means that, if you assign...

c program to find the size of int float double and char

C program to find the size of int, float, double and char  #include int main() { int intType; // integer value float floatType; // Constant value double doubleType; // double Constant value char charType; // Character value // sizeof evaluates the size of a variable ...

Sunday, March 29, 2020

What is Input Output in C Language .

Input and Output (I/O) In this you will learn to use scanf() function to take input from user and printf() function to display the result to the user. C Output In C programming, Printf() funcation is the main output function to display result to user. The function sends formatted output to the screen. Example...

Recent Posts