Tuesday, November 22, 2011

Program in C to Find Even or Odd Number

It is a sample c program to find even or odd number.

Program Source Code


#include"stdio.h"
#include"conio.h"
void main()
{
int n ;
clrscr();
printf("\n ***Check 'even' ** or ** 'odd'**** ");
printf("\n Enter the number to check:-- ");
scanf("%d",&n);
if (n%2==0)
printf("\n Given no is even:--");
else
printf("\n Given no is odd:--");
getch();
}

Output


Even or Odd Number in C Program

C Program to Check String is Palindrome or Not

It is a sample C language example. It is a string palindrome program which accept a string from user.
It checks that accepted string is a palindrome string or not. If string or string reverse is as same as then this string is a palindrome string. It means read string same in both forward or backward direction.



Aim - C program to check whether the accepted string is palindrome or not.


Program Source Code
//C Program to check accepted string is palindrome or not
#include"stdio.h"
#include"conio.h"
int isPallindrome(char *);
void main()
{
  int a;
  char str1[30];
  clrscr();
  printf("\n******String Palindrome******\n");
  printf("Enter a string: ");
  gets(str1); // accept string from user
  a=isPallindrome(str1);  /*function calls, accept string as argument and return flag value*/

  if(a)
   printf("\nstring: %s is a palindrome string",str1);
  else
   printf("\nstring: %s is not a palindrome string",str1);
  getch();

}


int isPallindrome(char *str2)
{
   int i,j,flag=1;

   for(i=0,j=strlen(str2)-1; i<j; i++, j--)
 {
    if(str2[i]!=str2[j]) /*starts checking from ends of string to middle*/
  {
    flag=0; /*if reverse of string is not same than return 0*/
    break;
  }

 }
   return(flag);
}


Output1
******String Palindrome******
Enter a string: MADAM
string: MADAM is a palindrome string

Output2
******String Palindrome******
Enter a string: HELLO
string: HELLO is not a palindrome string




Sunday, November 20, 2011

Sample resume for freshers

Hi Guys, This it the time of campus recruitment and many final year and pre final year students are looking for resume. Here I am sharing a sample resume for fresher. If you are fresher then this format will help you for initiating your resume. This very simple resume style with all basic details. Sample Resume for Freshers

Please share other resume formats with us. Thank you.

C Program to Find Armstrong Series

It is a sample c program to generate Armstrong number series from 1 to 1000. 

Program Source Code

//C Program to Find All Armstrong Number between 1 to 1000. #include"stdio.h" #include"conio.h" void main() { int no,r,sum=0,i; clrscr(); printf("\n\n***The Armstrong No. Series Between 1 and 1000 are:*** "); for(i=1;i<=1000;i++) { sum=0; no=i; while(no!=0) { r=no%10; no=no/10; sum=sum+(r*r*r); } if(sum==i) printf("\n%d",i); } getch(); }
Output