C Function Kilo Bytes to Bytes

C Function Kilo Bytes to Bytes – C Program to convert kilo bytes into bytes using a user defined function. Source Code   #include <stdio.h> int kb2byte(int kb) { return kb * 1024; } int main() { int k,b; printf(“Enter Kilo Bytes to convert into Bytes:”); scanf(“%d”,&k); b = kb2byte(k); printf(“%d KB = %d Bytes”,k,b);… Read More: C Function Kilo Bytes to Bytes »

Loading

Check Even Odd with Switch Statement

Check Even Odd with Switch Statement – C Program to input a number and check it for even or odd using a switch statement. Source Code #include <stdio.h> int main() { int n; printf(“Enter a number to check for Even/Odd:”); scanf(“%d”,&n); switch(n%2) { case 0: printf(“%d is Even”,n); break; case 1: printf(“%d is Odd”,n); break;… Read More: Check Even Odd with Switch Statement »

Loading

Check Palindrome String C Program

Check Palindrome String C Program – Input a string and check whether this string entered by the user is a Palindrome or Not. Source Code #include <stdio.h> #include <string.h> int main() { char str[100]; int i,size,palindrome=1; printf(“Enter the string : “); gets(str); size=strlen(str); for(i=0;i<size/2;i++) { if(str[i]!=str[size-i-1]) { palindrome=0; break; } } if(palindrome==1) printf(“%s string is… Read More: Check Palindrome String C Program »

Loading

Count Digits in String C Program

Count Digits in String C Program – Input a string containing both digits and alphabets. This program in C language will display the count of digits in the given string. Source Code /* * C program to count the digits present in the given string */ #include <stdio.h> void main() { char str[100]; int i,count=0;… Read More: Count Digits in String C Program »

Loading