Welcome to Millillion Tech

Millillion Tech is not a only blog, it is a landmark of technological knowledge.

Translate

Wednesday, June 24, 2015

Using linked list, write a C program, that will input some students' Id, Name, Department and CGPA respectively and print them.

#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> #define SIZE 20 struct diu_cse {     int id;     char name[SIZE];     char department[SIZE];     float cgpa;     struct diu_cse *next; }; struct diu_cse *head=NULL; struct diu_cse *curr=NULL; struct diu_cse* create_list(int id, char name[],char department[], float cgpa) {    ...

Thursday, June 11, 2015

Queues implementation( add, remove, peek) in C programming

#include <stdio.h> #define MAX 50 int queue_array[MAX]; int rear = -1; int front = -1; void main() {     int choice;     while (1)     {         printf("1.Insert element to queue \n");         printf("2.Delete element from queue \n");         printf("3.Display all elements of queue \n");        ...

Sunday, June 7, 2015

Stack implementation( Push, Pop, Display) in C programming.

#include<stdio.h> #include<conio.h> #include<stdlib.h> #define size 5 struct stack {     int s[size];     int top;     } st; int stfull() {     if (st.top>= size -1)         return 1;     else         return 0; } push(int item) {     st.top++;    ...

Thursday, June 4, 2015

C Programming- linked list, creating nodes, inserting "after", inserting "before", searching(Traversing) and deletion

#include<stdio.h> #include<stdlib.h> #include<stdbool.h> #include<conio.h> struct test_struct {     int val;     struct test_struct *next; }; struct test_struct *head = NULL; struct test_struct *curr = NULL; struct test_struct* create_list(int val) {     printf("\nCreating list with headnode as %d\n",val);     struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct...

C programming code for leap year.

#include<stdio.h>void main(){    int year;    printf("Enter a year:  ");    scanf("%d", &year);    if((year%4 == 0) && (year%100 != 0) ||(year%400 == 0))        printf("%d is a leap year", year);    else        printf("%d is not a leap year", year);    return 0;} Download...

Write a C program that will input some students' obtained marks and count the number of A+, A, A-, B+.....

#include<stdio.h> int main() {     int n;     printf("Number of students: ");     scanf("%d", &n);     int arr[n],i,j, check=0;     printf("Enter obtained marks of the students: ");     for(i=0;i<n; i++){         scanf("%d",&arr[i]);     }     for(i=0;i<n; i++){        ...

Write a C program that will convert temperature from celcius to fahrenheit and fahrenheit to celcius. Input values from user.

#include<stdio.h> #include<math.h> void main() {     char user;     float clcs, farn, celcius, fahrenheit;     printf("For celsius to fahrenheit press 'a' ");     printf("\nFor fahrenheit to celsius press 'b' \n");     scanf("%c", &user);     switch(user){         case 'a':        ...

Write a C program that calculate the average of three integers. Input the values from user.

#include<stdio.h> void main() {     float a,b,c,avrg;     printf("A?  ");     scanf("%f", &a);     printf("B?  ");     scanf("%f", &b);     printf("C?  ");     scanf("%f", &c);     avrg= (a+b+c)/3;     printf("%f", avrg); } Download source c...

Write a C programm that will calculate the area of triangle, rectangle and circle. Input the choice and values from user.

#include<stdio.h>void main(){    char user;    float area,l,b,h,w,r,pi=3.1416;    printf("To calculate the area of\n\nA triangle press 'a'\nA rectangle press 'b'\nA circle press 'c'\n\nInput here:");    scanf("%c", &user);    switch(user){        case 'a':{            printf("Base:...

Write a C program thar will enter a line of text, store in an array and then display it backwards.

#include<stdio.h>void main(){    char line[80];    int i, l=0;    printf("Write a line: \n ");    gets(line);    l= strlen(line);    for(i=l;i>=0; --i){        printf("%c", line[i]);    }} Download source c...