Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
c x 15
c++ x 1
Member Avatar for Alfy

I am kinda new to world of c programming, and i have been assigned a problem that is written as follows: Write a procedure that counts the number or words in a string. Write a program to test your new procedure. I am kinda lost on this completely. Any help …

Member Avatar for zeroliken
0
2K
Member Avatar for Alfy

[code] struct student { char name[20]; int age; int id; }; struct student *sp, st[3],temp ; void sort(struct student *p) { *sp=st[0]; p->age; for(i=0; i<3; i++) { if(st[i].age<st[i+1].age) continue; else if(st[i].age>st[i+1].age) { temp=st[i]; st[i]=st[i+1]; st[i+1]=temp; }break; } } /* switch case junk */ case 1: /* sort by age */ …

Member Avatar for Alfy
0
142
Member Avatar for Alfy

#include <stdio.h> #include <string.h> int i,k,type; char buffer[100],l,line[50]; struct student { char name[20]; int age; int id; }; struct student st[2],temp,*sp; int sort(struct student *p) { *sp=st[0]; p->age; for(i=0; i<l; i++) { if(st[i].age<st[i+1].age) break; else if(st[i].age>st[i+1].age) { temp=st[i]; st[i]=st[i+1]; st[i+1]=temp; }break; } printf("\t\tsorted student information\n--------------------------\n"); printf("%d",st[i].age); return(0); } int main() …

Member Avatar for jwenting
0
164
Member Avatar for Alfy

[code] int ans, guess, random, type, counter, num, i; char option[20], numb[10], input[5]; int power(int num) { ans=2; if(num==0) { return(1); } if(num<0) { printf("incorrect input, please input a positive integer:"); return(0); } else for(i=1; i!=num; i++) { return(ans=ans*2); } return(0); } int main() { /*before this there is all …

Member Avatar for kunal_ktr
0
153
Member Avatar for Alfy

[code] #include <stdio.h> int i,type; int buffer[100],line[50]; struct student { char name[20]; int age; int id; }; struct student students[3]; int main() { for(i=0;i<3;i++) { printf("please enter your name:\n"); fgets(students[i].name,sizeof(students[i].name),stdin); printf("please enter your age:\n"); fgets(buffer,sizeof(buffer),stdin); sscanf(buffer,"%d",&students[i].age); printf("please enter your id:\n"); fgets(buffer,sizeof(buffer),stdin); sscanf(buffer,"%d",&students[i].id); } while(1) { int *ptr=students; printf("Please enter the …

Member Avatar for Narue
0
143
Member Avatar for Alfy

i am suppose to multiply the two matrices together using a for loop, but the only way i can figure it out is by using printf( a[0][0] * b[0][0] + a[0][1] * b[1][0]) 4 times to find each piece. Please help. #include <stdio.h> int main() { int i,j,k; int a[2][2]={{1,2},{3,2}}; …

Member Avatar for Waskar
0
137
Member Avatar for Alfy

write a function begins(string1, string2) that reurns true if string1 begins string2. Write a program to test the function. program: #include<stdio.h> #include<string.h> char begins(char sentence1[],char sentence2[]) { int i,j=0; for(i=0;sentence1[i]!='\0';++i) { if(sentence1[i]==sentence2[i]) j=j+1; else if(j==i) printf("True\n"); } return(0); } int main() { int i, j=0; char string1[100],string2[100]; printf("Enter a sentence:\n"); …

Member Avatar for Alfy
0
117