value); p=p->next; } } void siperfaqja(){ printf("Test"); int a,b; int sip=a*b; printf( : Notes">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include<stdio.h>
#include<stdlib.h>

struct node{
int value;
struct node*next;
};

void printLinkedList(struct node*p){
while (p !=NULL){
printf("%d", p->value);
p=p->next;
}
}

void siperfaqja(){
printf("Test");
int a,b;
int sip=a*b;
printf("Siperfaqja eshte %d",sip);
}
int main(){
struct node *head;
struct node *one=NULL;
struct node *two=NULL;
struct node *three=NULL;

one=malloc(sizeof(struct node));
two=malloc(sizeof(struct node));
three=malloc(sizeof(struct node));

one->value = 1;
two->value = 2;
three->value = 3;

one->next = two;
two->next = three;
three->next = NULL;
head = one;

printLinkedList(head);
siperfaqja();

}



#include <iostream>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
bool regjistro_studentin(struct student *stud,struct list *ls);
double llogarit_totalin(struct student *);
void shtoTeLista(struct student *stud, struct list *l);
void shfaqListen(struct student *stud, struct list *l);
struct student
{
char name[20];
int notat_gjimnazit, notat_matures, nota_testit_pranues;
student *next;
//--> 10 % weightage to metric, 50% to fsc, 40% to entry test...
};
struct list
{
char name[20];
double aggr;
list *next;
};
int main()
{
student *s; //--> Krijimi objektit te studentit...
s = (struct student *) malloc(sizeof(struct student));
struct list *ls;
ls = (struct list *) malloc(sizeof(struct list));
strcpy(ls->name, "");
ls->aggr = 0;
ls->next= NULL;
do
{
cout<<"Shtyp 1 per te hedhur nje student te rin";
cout<<"Shtyp 2 per te shfaqur studentet e regjistruarn";
cout<<"Shtyp 3 per te dale nga programin";
int input;
cin>>input;
if (input == 1)
{
regjistro_studentin(s, ls);
}
else if (input == 2)
{
shfaqListen(s, ls);
}
else if (input == 3)
exit(0);
cout<<"n";
} while(1);
getch();
}
bool regjistro_studentin(struct student *stud,struct list *ls)
{
student *s = stud;
cout<<"Shkruaj emrin e studentitn";
cin>>s->name;
cout<<"Vendos nr e universitetit (1-10)n";
cin>>s->notat_gjimnazit;
cout<<"Vendos mesataren e gjimnazitn";
cin>>s->notat_matures;
cout<<"Vendos mesataren e provimeve te maturesn";
cin>>s->nota_testit_pranues;
double aggregiate;
aggregiate = llogarit_totalin(s); //-->Krijimi i funksionit
cout<<"Piket sipas notes "<< aggregiate<<"n";
if (aggregiate >= 7)
{
cout<<"Student registered in Electricaln";
shtoTeLista(s,ls);
return true;
}
else if (aggregiate >= 6)
{
cout<<"Student registered in Mechanicaln";
shtoTeLista(s,ls);
return true;
}
else if (aggregiate >=5)
{
cout<<"Student registered in CSEn";
shtoTeLista(s,ls);
return true;
}
else
{
cout<<"Sorry, the student can't be registered in engineeringn";
return false;
}
}
double llogarit_totalin(struct student *stud)
{
student *s = stud;
double aggr;
aggr = s->notat_gjimnazit * 10/10 + s->notat_matures * 50/10 +
s->nota_testit_pranues * 40/10;
return aggr;
}
void shtoTeLista(struct student *stud, struct list *l)
{
list *pointer = l;
while (pointer->next != NULL)
{
pointer = pointer->next;
}
pointer->next = (struct list *) malloc(sizeof(struct list));
pointer = pointer->next;
strcpy(pointer->name , stud->name);
pointer->aggr = llogarit_totalin(stud);
pointer->next = NULL;
}
void shfaqListen(struct student *stud, struct list *l)
{
list *pointer = l;
if (pointer->next == NULL)
cout<<"No student registered yet!n";
else
{
cout<<"Students statistics are: n";
while (pointer->next != NULL)
{
pointer = pointer->next;
cout<<"Name of student is: "<<pointer->name<<"n";
cout<<"Aggregiate of student is: "<<pointer->aggr<<"n";
if (pointer->aggr >= 70)
cout<<"Student registered in Electricaln";
else if(pointer->aggr >=60)
cout<<"Student registered in Mechanicaln";
else
cout<<"Student registered in CSEn";
cout<<"n";
}
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.