S

@Shobh89

C Program to Add Two Integers

C
1 year ago
#include <stdio.h> int main() { //First Number int a=5; //Second number int b=9;

C Program To Multiply Two Floating-Point Numbers

C
1 year ago
//C program to multiply two //floating point numbers #include <stdio.h> //Function to multiply floating point //numbers float multiply(float a,float b) { return a*b; }

C Program To Print ASCII Value of a Character Using Format Specifier

C
1 year ago
//C program to print ASCII Value of Character using //implicit conversion with format specifier #include <stdio.h> int main() { char c='k'; //%d displays the integer value of //a character //%c displays the actual character

C Program to Swap Two Numbers

C
1 year ago
// C Program to Swap Two Numbers using a Temporary Variable #include <stdio.h> int main() { int a=5,b=10,temp; printf("Before swapping: a=%d,b=%d\n",a,b); //Store the value of a in temp temp=a;

C Program to Find the Size of int, float, double and char

C
1 year ago
//C program to Find the Size of int,float,double,and //char using sizeof operator directly #include <stdio.h> int main() { //Determine and Print the size of int printf("Size of int: %u bytes\n",sizeof(int)); //Determine and Print the size of float

C program to add two complex numbers

C
1 year ago
//C program to demonstrate //addition of complex numbers #include <stdio.h> //define a structure for complex number. typedef struct complexNumber { int real; int img; }complex;

C Program to Print Prime Numbers From 1 to N

C
1 year ago
#include<stdbool.h> #include <stdio.h> #include<math.h> //This function is to check //if a given number is prime bool isPrime(int n) { // 0 and 1 are not prime numbers if(n==1 || n==0)

C Program To Check Neon Number

C
1 year ago
//C Program to demonstrate whether //a number is Neon Number or not #include <stdio.h> int Check_Neon_Number(int num){ //Calculating the square of the number int square=num*num; //Copying the square in a variable

C program to find Simple interest

C
1 year ago
//C program to find Simple interest #include<stdio.h> int main() { //Input values float P=1,R=1,T=1; //Calaulate Simple Interest float SI=(P*T*R)/100;

Read/Write Structure From/to a File in C

C
1 year ago
//C program for writing //struct to file #include <stdio.h> #include<stdlib.h> //a struct to be read and written struct person{ int id; char fname[20]; char lname[20];

Check if a string is palindrome in C using pointers

C
1 year ago
//C program to check if a string is palindrome //using pointers #include <stdio.h> //Function to check if the string is palindrome //using pointers void isPalindrome(char* string) { char *ptr,*rev;

Convert Decimal to Binary in C

C
1 year ago
// C Program to convert Decimal Numbers to Binary #include <stdio.h> //function to convert decimal to binary void decToBinary(int n) { //array to store binary number int binaryNum[1000];

C Program to Concatenate Two Strings without using strcat()

C
1 year ago
//C program to Concatenate two string without using //concat() #include <stdio.h> //Function to concatenate two strings void concatenateStrings(char* str1,const char*str2) { //Navigate to the end of the first string while(*str1){ ++str1;

C Program to Reverse a Stack using Recursion

C
1 year ago
// C program to reverse a // stack using recursion #include <stdio.h> #include <stdlib.h> #define bool int // structure of a stack node struct sNode { char data; struct sNode* next;

C Program to Find All Factors of Number

C
1 year ago
//C implementation of Naive //method to print all divisors #include <stdio.h> //Function to print all divisors void printDivisors(int n) { for(int i=1;i<=n;i++) if(n%i == 0) printf("%d ",i);

C Program For Compound Interest

C
1 year ago
//C program to calculate Compound Interest #include<stdio.h> //For using pow function we must //include math.h #include<math.h> //Driver Code int main() {

Display the Program

C
1 year ago
//C program that prints this code. #include <stdio.h> //Driver code int main(void) { //We can append this code to any c program //such that it prints this code. char c; FILE *fp=fopen(__FILE__,"r");

FILE Macro Method(Printing File Name)

C
1 year ago
//C Program to display the //location of the file #include<stdio.h> //Driver Code int main() { //Prints location of C this C Code printf("%s",__FILE__); }

Program for converting hours into minutes and seconds

C
1 year ago
//C program to convert hours //into minutes and seconds #include<stdio.h> //Function to convert hours into //minutes and seconds void ConvertHours(int n) { long long int minutes,seconds;

Flexible Array Members in a structure in C

C
1 year ago
// C program for variable length members in //structures in GCC #include <stdio.h> #include <stdlib.h> #include <string.h> //A structure of type student struct student{ int stu_id; int name_len;