en
Feedback
Coder Baba

Coder Baba

Open in Telegram

Everything about programming for beginners. 1 and only official telegram channel of CODERBABA India. Content: .NET Developer, Programming (ASP. NET, VB. NET, C#, SQL Server), & Projects follow me https://linktr.ee/coderbaba *Programming *Coding *Note

Show more
2 312
Subscribers
No data24 hours
-67 days
-3030 days
Posts Archive
Add digits using recursion #include <stdio.h> int add_digits(int); int main() { int n, result; scanf("%d", &n); result = add_digits(n); printf("%d\n", result); return 0; } int add_digits(int n) { static int sum = 0; if (n == 0) { return 0; } sum = n%10 + add_digits(n/10); return sum; }

add digits of number in c C program to add digits of a number: Here we are using modulus operator(%) to extract individual digits of number and adding them. C programming code #include <stdio.h> main() { int n, sum = 0, remainder; printf("Enter an integer\n"); scanf("%d",&n); while(n != 0) { remainder = n % 10; sum = sum + remainder; n = n / 10; } printf("Sum of digits of entered number = %d\n",sum); return 0; }

c program to check leap year c program to check leap year: c code to check leap year, year will be entered by the user. Please read the leap year article before reading the code, it will help you to understand the program. C programming code #include <stdio.h> int main() { int year; printf("Enter a year to check if it is a leap year\n"); scanf("%d", &year); if ( year%400 == 0) printf("%d is a leap year.\n", year); else if ( year%100 == 0) printf("%d is not a leap year.\n", year); else if ( year%4 == 0 ) printf("%d is a leap year.\n", year); else printf("%d is not a leap year.\n", year); return 0; }

Function to check vowel int check_vowel(char a) { if (a >= 'A' && a <= 'Z') a = a + 'a' - 'A'; /* Converting to lower case or use a = a + 32 */ if (a == 'a' a == 'e' a == 'i' a == 'o' a == 'u') return 1; return 0; }

Check vowel using switch statement #include <stdio.h> main() { char ch; printf("Enter a character\n"); scanf("%c", &ch); switch(ch) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': printf("%c is a vowel.\n", ch); break; default: printf("%c is not a vowel.\n", ch); } return 0; }

c program to check whether input alphabet is a vowel or not This code checks whether an input alphabet is a vowel or not. Both lower-case and upper-case are checked. C programming code #include <stdio.h> main() { char ch; printf("Enter a character\n"); scanf("%c", &ch); if (ch == 'a' ch == 'A' ch == 'e' ch == 'E' ch == 'i' ch == 'I' ch =='o' ch=='O' ch == 'u' || ch == 'U') printf("%c is a vowel.\n", ch); else printf("%c is not a vowel.\n", ch); return 0; } Output: a a is vowel

Find odd or even using conditional operator #include<stdio.h> main() { int n; printf("Enter an integer\n"); scanf("%d",&n); n%2 == 0 ? printf("Even number\n") : printf("Odd number\n"); return 0; }

C program to check odd or even without using bitwise or modulus operator #include<stdio.h> main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( (n/2)*2 == n ) printf("Even\n"); else printf("Odd\n"); return 0; }

C program to check odd or even using bitwise operator #include<stdio.h> main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n & 1 == 1 ) printf("Odd\n"); else printf("Even\n"); return 0; }

C program to check odd or even using modulus operator #include<stdio.h> main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n%2 == 0 ) printf("Even\n"); else printf("Odd\n"); return 0; }

SAMPLE Resume (1).docx0.47 KB

Fitness NUTRITION PLAN πŸ’ͺ

Project Requirement Details for Final year Project Demo document for your information

Folder Structure for Software TestingπŸ‘†πŸ‘†

photo content

what is Web Services
what is Web Services

photo content

photo content

ADO .NET
ADO .NET

SQL Server + ASP.NET = Powerful Web Applications