Posts

Assignments Sem-I C programming

 B.Sc. Part – I Computer Science (Optional) (Semester –I) (NEP) Course I Course Code: CS – 103 Course Title: Practical Based on CS-101 and CS–102 Credits: 02 Total Marks: 50 Practical Based on DSC – I 1.Write a program to convert the given temperature from Fahrenheit to Celsius 2. Write a program to find the area of rectangle, square, circle and triangle by accepting suitable input parameters from user. 3. Write a program to accept 4 subject marks and calculate total marks, percentage and grade of student. 4. Write a program to input a number and find the given number is Odd or Even. 5. Write a menu driven program to convert the given temperature from Fahrenheit to Celsius and vice versa depending upon user’s choice. 6. Write a program to find factorial of a given number. 7. Write a program to display the first n terms of Fibonacci sequence. 8. Write a program to print palindrome numbers between given range. 9. Write a program to find sum of the following series for n terms: 1 – 3/...

Tokens in C

Tokens in C            In C programming, tokens are the smallest units in a program that have meaningful representations. Tokens are the building blocks of a C program, and they are recognized by the C compiler to form valid expressions and statements. Tokens can be classified into various categories, each with specific roles in the program.   Types of Tokens in C The tokens of C language can be classified into six types based on the functions they are used to perform. The types of C tokens are as follows: 1. Punctuators The following special symbols are used in C having some special meaning and thus, cannot be used for some other purpose. Some of these are listed below: Brackets[]:  Opening and closing brackets are used as array element references. These indicate single and multidimensional subscripts. Parentheses():  These special symbols are used to indicate function calls and function parameters. Braces{}:  These opening and ending c...

Functions printf() and scanf() in C

  Functions printf() and scanf() in C The  printf() and scanf() functions  are the most commonly used functions in C Programming. These functions are widely used in majority of the C programs. In this tutorial, you will learn, what are these functions, how to use them in C Program. The  scanf()  and  printf()  functions are used for input and output in c programs receptively. These functions are defined in  stdio.h  header file, so you must include this header file in your program, if you are using any of these functions. printf() function: The prinf() function is used to display (or print) output on the console screen. Syntax of printf() function: printf ( "format string" , arguments ); The format string (or  format specifier ) is a string that is used for formatting the input and output. Format string always starts with a ‘%’ character. For example format string for integer is %d, for string %s, for float %f and so on. scanf() fun...

Data Types

Image
  Data Types In the declaration of every variables it is mandatory to specify it data type. It is representation of a data Classification  of data type Basically three types Primitive  Derived  User-defined  1.Primitive Data types:- It is subdivided into sub data types  Data we are storing with the help of the size of the data int char float void 2.Derived datatype:- Array String  Pointer  Functions 3.User-defined :- Stretcher  Union typedef enum The memory size of the basic data types may change according to 32 or 64-bit operating system. Let's see the basic data types.  Data Types Memory Size Range char 1 byte −128 to 127 signed char 1 byte −128 to 127 unsigned char 1 byte 0 to 255 short 2 byte −32,768 to 32,767 signed short 2 byte −32,768 to 32,767 unsigned short 2 byte 0 to 65,535 int 2 byte −32,768 to 32,767 signed int 2 byte −32,768 to 32,767 unsigned int 2 byte 0 to 65,535 short int 2 byte −32,768 to 32,767 signed short...

C Library and IDE

Image
  C Library:- C library is collection of header files. Every header file is collection  of related set of predefined functions Ex:-stdio.h   ,conio.h  ,string.h, math.h, graphics.h, dos.h Standard Header Files And Their Uses: #include<stdio.h>:  It is used to perform input and output operations using functions  scanf()  and  printf() . #include<iostream>:  It is used as a stream of Input and Output using cin and cout. #include<string.h>:  It is used to perform various functionalities related to string manupulation like strlen(), strcmp(), strcpy(), size(), etc. #include<math.h>:  It is used to perform mathematical operations like sqrt(), log2(), pow(), etc. #include<iomanip.h>:  It is used to access set() and setprecision() function to limit the decimal places in variables. #include<signal.h>:  It is used to perform signal handling functions like  signal() ...

Basic of c programming and Variables

  C Language Introduction         C  is a procedural programming language. It was initially developed by Dennis Ritchie in the year 1972 .  It was mainly developed as a system programming language to write an operating system.  The main features of C language include low-level access to memory, a simple set of keywords, and clean style, these features make C language suitable for system programmings like an operating system or compiler development. Many later languages have borrowed syntax/features directly or indirectly from C language.  Like syntax of Java, PHP, JavaScript, and many other languages are mainly based on C language. C++ is nearly a super set of C language (There are few programs that may compile in C, but not in C++). Types of applications:- Standalone Applications Web Applications 1.Standalone Applications:- Must be installed (ex:- VLC player,ms- office,etc). Compatible for single -OS. 2. Web Applications:- No need install...