Giter Club home page Giter Club logo

introduction_to_c's Introduction

INTRODUCTION_TO_C

This file contains algorithms for respective experiments. These experiments are basic codes for Introduction To C- Programming. The other reporsitories contain the applicaiton and other important topics and their Experiments.

EXPERIMENT-1 (HELLO WORLD)

a. Start and include #include <stdio.h> .

b. Use printtf command and type "Hello World".

c. End program.

RESULT- The algorithm and the created code will print "Hello World". HELOWORLD

EXPERIMENT-2 (PRINTF AND SCANF)

a. Start.

b. Enter the number(printf).

c. Scan the number(scanf).

d. Print the number(printf).

e. End.

OP SCANF

EXPERIMENT-3 (IF-ELSE)

a. Start.

b. Enter the number(printf).

c. Scan the number(scanf).

d. If the number is greater than or equal to 6, print valid.

e. Else the number is lesser than 6, print Inv.

f. End.

ELSEIF

EXPERIMENT-4 (POINTERS) A pointer is a variable that stores the memory address of another variable as its value.

a. Start.

b. Specify variable.

c. Create pointer variable *ap and store it in 'a'.

d. Create set of print f commands for: address and value of th evariable and the value of the pointer for the respective variable.

e. End.

POINTERS

EXPERIMENT-5 (STRUCTURES) Structures (also called structs) are a way to group several related variables into one place.

a. Start and declare struct before int main().

b. Include different data types, e.x. Employee or student details.

c. Print the name, year of joining and other details.

d. Store and print values by using &x.DETAIL.

e. Print all details.

f. End.

Structure

EXPERIMENT-6 (POWERS)

a.Start the program.

b. Declare an integer variable n.

c. Display a message "Enter a number: ".

d. Read an integer value from the user using the scanf function and store it in the variable n.

e. Check if the value of n is 0. If yes, print the message "%d is not a power of 2." where %d is replaced by the value of n.

f. If the value of n is not 0, check whether n & (n-1) is equal to 0.

  1. If it is equal to 0, then n is a power of 2.

  2. If it is not equal to 0, then n is not a power of 2.

g. Print the appropriate message based on the above checks.

h. End the program by returning 0.

POWER-1 POWER-2

introduction_to_c's People

Contributors

steve1090 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.