22 Aug 2021, 10:46 UTCβ301,000 viewsread 29 September 2026 144. Circular Link List.
#include<stdio.h>
#include<stdlib.h>
typedef struct Node {
int data;
struct Node *next;
} node;
void insert(node *pointer, int data)
{
node *start = pointer;
while (pointer->next != start)
{
pointer = pointer->next;
}
pointer->next = (node *)
malloc(sizeof(node));
pointer = pointer->next;
pointer->data = data;
pointer->next = start;
β¦
Signed jeNiSh
8 May 2021, 09:43 UTCβ295,000 viewsread 29 September 2026 143. Program to allocate memory using malloc() and free memory using free().
#include<stdio.h>
#include<stdlib.h>
int main() {
int n, i, *ptr, sum = 0;
printf("Enter total number of elements : ");
scanf("%d", &n);
ptr = (int *) malloc(n * sizeof(int));
if (ptr == NULL) {
printf("Error! Memory not allocated.");
return 0;
}
printf("Enter elements of array : \n");
foβ¦
Signed jeNiSh
8 May 2021, 09:33 UTCβ267,000 viewsread 29 September 2026 142. Program to concatenate two strings using pointer.
#include <stdio.h>
void concatenator(char *str, char *substr) {
while (*str)
str++;
while (*substr) {
*str = *substr;
substr++;
str++;
}
*str = '\0';
}
int main() {
char str[100], substr[100];
printf("Enter the source string : ");
gets(str);
printf("\nEnter string to concatenate : ");
geβ¦
Signed jeNiSh
28 Feb 2021, 18:46 UTCβ267,000 viewsread 29 September 2026 141. WAP to multiply and add two complex numbers
Input :
5
-4
4
6
Output :
Sum is 9 + 2i
Product is 44 + 14i
#include<stdio.h>
#include<conio.h>
typedef struct {
int real;
int imag;
} complex;
void getdata (complex *);
void display (complex);
complex sum(complex,complex);
complex mult(complex,complex);
main() {
complex c1,c2,c3,c4;
getdata(&c1);
getdata(&c2);
c3=sum(c1,c2);
printf("Sum is ");
displayβ¦
Signed jeNiSh
30 Jan 2021, 20:38 UTCβ236,000 viewsread 29 September 2026 140. Program to find day on a particular date
#include<stdio.h>
int isLeapYear(int year){
if(year%4==0){
if(year%100==0 && year%400!=0){
return 0;
}
else{
return 1;
}
}
else{
return 0;
}
}
int main() {
int year;
int refYear=1600, leap=0;
int diff, totalDays,day,month, oddDays;
int lYear[]={3,1,3,2,3,2,3,3,2,3,2,3};
β¦
Signed jeNiSh
30 Nov 2020, 02:40 UTCβ237,000 viewsread 29 September 2026 139. Program to read multiline string using scanf.
#include<stdio.h>
int main(void) {
char str[100];
// reading multline string with '.' as a delimiter
scanf("%[^.]",str);
printf("%s",str);
return 0;
}
#program_by : @freakyLuffy
Signed jeNiSh
30 Nov 2020, 02:38 UTCβ226,000 viewsread 29 September 2026 138. Program to split words from a string using strtok function.
#include <stdio.h>
#include<string.h>
int main(void) {
char str[]="Welcome to C language";
char *token=strtok(str," ");
while(token!=NULL)
{
printf("%s\n",token);
token=strtok(NULL," ");
}
return 0;
}
#program_by : @freakyLuffy
Signed jeNiSh
17 Nov 2020, 19:35 UTCβ222,000 viewsread 29 September 2026 137. Program to check whether the number is palindrome or not using recursion.
#include<stdio.h>
int checkPalindrome(int);
int main() {
int n, sum;
printf("Enter a number : ");
scanf("%d",&n);
sum = checkPalindrome(n);
if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);
return 0;
}
int checkPalindrome(int n) {
static int sβ¦
Signed jeNiSh
17 Nov 2020, 06:54 UTCβ202,000 viewsread 29 September 2026 136. Binary search using recursion
#include<stdio.h>
int binary(int arr[], int n, int search, int l, int u);
int main()
{
int arr[10], i, n, search, c, l, u;
printf("Enter the size of an array : ");
scanf("%d", &n);
for (i = 0; i < n; i++)
{
printf("Enter the element %d : ", i+1);
scanf("%d", &arr[i]);
}
printf("Enter the number to be search: ");
scanf("%d", &searβ¦
Signed jeNiSh
16 Jul 2020, 18:31 UTCβ232,000 viewsread 29 September 2026 135. Sieve of Eratosthenes : An algorithm to generate all the prime numbers within an range.
#include <stdio.h>
#define size 1000
int main (void)
{
int n;
scanf("%d",&n);
int arr[size]={0};
for(int i=2;i*i<=n;i++)
{
for(int j=i;i*j<=n;j++)
{
arr[i*j]=1;
}
}
for(int i=2;i<=n;i++)
{
if(!arr[i])
printf("%d ",i);
}
return 0;
}
β¦
Signed jeNiSh
12 Jul 2020, 18:22 UTCβ221,000 viewsread 29 September 2026 134. Program to delete a node for a given element from linked list.
#include <stdio.h>
#include<stdlib.h>
typedef struct node {
int data;
struct node *next;
}Node;
int main(void)
{
Node*temp;
Node*start=NULL;
Node* p=NULL;
int n;
scanf("%d",&n);
while(n--)
{
temp=(Node *)malloc(sizeof(struct node));
scanf("%d",&temp->data);
temp->next=NULL;
if(start==NULL)
{
start=teβ¦
Signed jeNiSh
12 Jul 2020, 18:06 UTCβ191,000 viewsread 29 September 2026 133. Program for creating and displaying a linked list.
#include <stdio.h>
#include<stdlib.h>
typedef struct node {
int data;
struct node *next;
}Node;
int main(void)
{
Node*temp;
Node*start=NULL;
Node* p=NULL;
int n;
scanf("%d",&n);
while(n--)
{
temp=(Node *)malloc(sizeof(struct node));
scanf("%d",&temp->data);
temp->next=NULL;
if(start==NULL)
{
start=temp;
p=β¦
Signed jeNiSh
Showing the 12 most recent of 20 posts we hold for @C_Codings. View and reaction counts are the latest single reading for each post, not a live figure, and a recent post is still accumulating both. A view count marked β was rounded by Telegram before we ever saw it β t.me prints views in full below 1,000 and to three significant figures above, so β1,200,000 means somewhere between 1,150,000 and 1,249,999. Unmarked counts are exact. Text is reproduced from the public post preview and truncated for length.