Giter Club home page Giter Club logo

special-programs-in-c's Introduction

C_Logo

Special-Programs-In-C

This repository includes many special program designed by using C programming language and basic level of data structures.

It includes several programs which guides you to learn C language better and also use the benefits of language for calculation.

Included Programs

  • Armstrong Number
  • Binary to Decimal Converter
  • Bitwise Addition
  • Fibonacci Values
  • Floyds Triangle
  • Leap Year
  • Palindrome Numbers
  • Perfect Numbers
  • Power of Integer
  • Prime Number
  • Pyramid of Stars
  • Strong Number
  • Sum Without Plus

Usage/Examples

A program to determine whether a number is PRIME or NOT

#include <stdio.h>
#include <math.h>

int main() {
    int number,val1,val2;
    printf("Enter a number which will be checked if it's prime: \n");
    scanf("%d",&number);

    val1=number;
    val2=ceil(sqrt(number));

    int count=0;

    for(int i=2;i<=val2;i++) {
        if(number%i==0) {
            count=1;
        }
    }

    if((count==0 && val1!=1) || val1==2) {
        printf("%d is a prime number",val1);
    } else {
        printf("%d is NOT a prime number",val1);
    }
    return 0;
}

๐Ÿ”— Links

linkedin

Feedback

If you have any feedback, please reach out to me at [email protected]

Authors

special-programs-in-c's People

Contributors

saddeg21 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.