Posts

Showing posts with the label C

Linked List | Data Structure With C

Image
CSZONE Linked List | Data Structure With C #include <stdio.h> #include <stdlib.h> // A Single Linked List Node struct Node{ int data; struct Node* next; }; void Display_Linked_List(struct Node* list){ while(list!=NULL){ printf("%d->",list->data ); list = list->next; } // For Avoiding last -> while printing in last printf("\b\b"); } int main(){ //Creating Nodes struct Node* head = NULL; struct Node* second = NULL; struct Node* third = NULL; //Allocate three Nodes head = (struct Node*)malloc(sizeof(struct Node)); second = (struct Node*)malloc(sizeof(struct Node)); third = (struct Node*)malloc(sizeof(struct Node)); //Assigning The Values head->data = 1; head->next = second; second->data = 2; second->next = third; third->data = 3; third->next = NULL; Display_Linked_List(head); return 0; }

C Star Pattern

cszone 1.C STAR PATTERN     1    10   101  1010 10101  1010   101    10     1 2.     1    12   123  1234 12345  1234   123    12     1

C || Star Pattern - Triangle

*    **  ***  **** *****

[Let Us C solution ] C Program To Convert Temperature

Image
Code : - #include<stdio.h> #include<windows.h> #include<conio.h> void main(){ float cel,fr; system("cls"); printf("\n\n\t\tCONVERSION IN TEMPRETURE"); printf("\n\n\n\t\tENTER VALUE IN FAHRENHEIT  : "); scanf("%f",&fr); cel=(5*fr-160)/9; printf("\n\n\t\tVALUE IN CELCIUS : %f",cel); getch(); } Download Files

[Let us C Solution ]C Program to find the average of n (n < 10) numbers using arrays

// Program to find the average of n (n < 10) numbers using arrays #include <stdio.h> int main () { int marks [ 10 ], i , n , sum = 0 , average ; printf ( "Enter n: " ); scanf ( "%d" , & n ); for ( i = 0 ; i < n ; ++ i ) { printf ( "Enter number%d: " , i + 1 ); scanf ( "%d" , & marks [ i ]); sum += marks [ i ]; } average = sum / n ; printf ( "Average = %d" , average ); return 0 ; } Output Enter n: 5 Enter number1: 45 Enter number2: 35 Enter number3: 38 Enter number4: 31 Enter number5: 49 Average = 39