Thursday, June 6, 2019

Hello world program in python

""" ***********************************************
programming Language :Python
Tool(IDE) used :Anaconda -> Spider
 Write a program to that returns the - sum of squares of all odd numbers from 1 to 25

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************"""
print("Hello Python\n");

output:::

Note:

please send the questions which you are facing problem in Python Language.

also write interview questions which are you faced in during interview related to Python Language.

so i can try to solve them and send you back.

Write a program to that returns the - sum of squares of all odd numbers from 1 to 25


/* ***********************************************
    Write a program to that returns the - sum of squares of all odd numbers from 1 to 25

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/

#include <stdio.h>
#include <stdlib.h>


 int func(void);

 void main()
{
    printf("%d\n",func());
}
int func(void)
{
    int num, s=0;
    for(num=1;num<=25;num++)
    {
        if (num%2!=0)
             s+=num*num;
    }
    return s;
}

output:::


Note:

please send the questions which you are facing problem in C Language.

also write interview questions which are you faced in during interview related to C Language.

so i can try to solve them and send you back.

Write a program to that uses a function with no arguments and no return values

/* ***********************************************
    Write a program to that uses a function with no arguments and no return values

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/

#include <stdio.h>
#include <stdlib.h>


void dispmenu(void);

void main()
{
int choice;
 dispmenu();
  printf("Enter your choice :\n");
   scanf("%d",&choice);

}
void dispmenu(void )
{
     printf(" 1. Create database\n");
     printf("2.Insert new record\n");
     printf("3.Modify a record\n");
     printf("4.Delete a record\n");
     printf("5.Display all records\n");
     printf("6.Exit\n");
}

output::;





Note:

please send the questions which you are facing problem in C Language.

also write interview questions which are you faced in during interview related to C Language.

so i can try to solve them and send you back.

Write a program to test formal arguments

/* ***********************************************
    Write a program to test formal arguments

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/

#include <stdio.h>
#include <stdlib.h>

main()
{
    int m=6,n=3;
     printf("%d\t",multiply(m,n));
     printf("%d\t",multiply(15,4));
     printf("%d\t",multiply(m+n,m-n));
     printf("%d\n",multiply(6,sum(m,n))) ;
}

int multiply(int x,int y)
{
     int p;
      p=x*y;
       return p;
}

int sum (int x , int y)
{
    return x+y;
}



output:::



Note:

please send the questions which you are facing problem in C Language.

also write interview questions which are you faced in during interview related to C Language.

so i can try to solve them and send you back.

Write a program to factorial of the given number

/* ***********************************************
    Write a program to factorial of the given number

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/


#include <stdio.h>
#include <stdlib.h>


long int factorial(int n);
int main()
{
    int a,b;
    printf("enter the number\n");
    scanf("%d",&a);
    //b=factorial(a);
    printf("factorial==%ld",factorial(a));
    return 0;
}

long int factorial(int n)
{
    int i;
    long int fact = 1;
    if (n==0)
        return 1;
    for(i=n;i>1;i--)
        fact*=i;
    return fact;

}
out put:::

program 2:

#include<stdio.h>
long fact(int n);
void main()
{
    int num;
    printf("Enter a number\n");
    scanf("%d",&num);
    printf("Factorial of %d is %ld\n", num,fact(num)) ;
}
long fact(int n)
{
    if (n==0)
        return(1);
    else
        return(n*fact(n-1));

}

output::
Enter a number
12
Factorial of 12 is 479001600

Note:

please send the questions which you are facing problem in C Language.

also write interview questions which are you faced in during interview related to C Language.

so i can try to solve them and send you back.

Write a program to find the given number is smaller or larger

/* ***********************************************
    Write a program to find the given number is smaller  or larger

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/




#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c;
    printf("Enter the number\n");
    scanf("%d%d",&a,&b);
    small_large_fn(a,b);

    return 0;
}
int  small_large_fn(int a,int b)
{
    if(a>b)
    {
        printf("a is bigger number\n");

    }
     else if(a<b)
    {
        printf("b is bigger number\n");
    }
    else
    {
        printf("both numbers are equal\n");
    }

}

out put:::


Note:

please send the questions which you are facing problem in C Language.

also write interview questions which are you faced in during interview related to C Language.

so i can try to solve them and send you back.

Write a program to find the given number is even or odd using functions

/* ***********************************************
    Write a program to find the given number is even or odd using functions

 date:06-06-2019
 created by:ANIL DURGAM

*****************************************************/


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b;
    printf("Enter a number\n");
    scanf("%d",&a);
    b=even_odd_fn(a);
    if(b==0)
    {
        printf("even number\n");
    }
    else
        {
            printf("odd number\n");
        }
    return 0;
}
  int  even_odd_fn(a)
  {
    int n=0;
    n=a%2;
    return n;


  }


out put:::



Note:
please send the questions which you are facing problem in C Language.
also write interview questions which are you faced in during interview related to C Language.
so i can try to solve them and send you back.

python class topic video