Posts

Showing posts with the label C

How to check a palindrome String

Palindrome String Checker Palindrome string is a word whose's reverse remains the same as the initial word. For example lets consider the world "mom", it's inverse is also "mom", such words are known as palindrome words. Words like "mummy" when inversed become "ymmum" such words are non-palindrome words. So let us make a program which would check if a number is palindrome or not. Let's do this in C first Palindrome Number checker in C ( Without Using any String Library Functions ) Then we might do it even in python The code in C   The Code in Python 3

Date Time Correcter in C

Question Develop a program to enter a date and check if it correct, keeping the days of each month and the concept of Leap year in mind.

Call By reference

Image
Call by Reference A classic example of call by reference is : #include <stdio.h> void add(int *num1,int *num2) {     *num1=5;     *num2=10; } int main() {     int a,b;     printf("\n Enter two numbers : ");     scanf("%d%d",&a,&b);     add(&a,&b);     printf("\n %d %d ",a,b);     return 0; }