Need Programming Assignment Help?

Get Help with Programming Assignment in Java, C/C++, Dot Net, PHP, Database and UML Diagrams

All posts in C Programming

C Program File Handling to List Files in Directory

C Program File Handling to List Files in Directory C Program File Handling to List Files in Directory – This section covers the C Programming Example File Handling to list files in Directory. #include <dirent.h> #include <stdio.h> int main(void) { DIR *d; struct dirent *dir; d = opendir(“.”); if (d) . . . Read more

C Program to Store Information of 10 students using Structure

C Programming Structure #include <stdio.h> struct student{ char name[50]; int roll; float marks; }; int main(){ struct student s[10]; int i; printf(“Enter information of students:\n”); for(i=0;i<10;++i) { s[i].roll=i+1; printf(“\nFor roll number %d\n”,s[i].roll); printf(“Enter name: “); scanf(“%s”,s[i].name); printf(“Enter marks: “); scanf(“%f”,&s[i].marks); printf(“\n”); } printf(“Displaying information of students:\n\n”); for(i=0;i<10;++i) { printf(“\nInformation for . . . Read more

C Program to Add 2 Numbers using Pointers

C Program Pointers #include <stdio.h> long add(long *, long *); int main() { long first, second, *p, *q, sum; printf(“Input two integers to add\n”); scanf(“%ld%ld”, &first, &second); sum = add(&first, &second); printf(“(%ld) + (%ld) = (%ld)\n”, first, second, sum); return 0; } long add(long *x, long *y) { long sum; . . . Read more

C Program Recursion

C Program Recursion #include<stdio.h> long factorial(int); int main() { int n; long f; printf(“Enter an integer to find factorial\n”); scanf(“%d”, &n); if (n < 0) printf(“Negative integers are not allowed.\n”); else { f = factorial(n); printf(“%d! = %ld\n”, n, f); } return 0; } long factorial(int n) { if (n . . . Read more

C Programming Strings

C Program to Find the Length of the String C Programming Using Strings. In this article, you’ll learn to handle strings and its operations in C. You’ll learn to declare them, initialize them and use them for various input/output operations. #include <stdio.h> #include <string.h> int main() { char a[100]; int . . . Read more

C Programming Array

C Program to Find the Sum of marks of n Students using Arrays An array is a collection of data items, all of the same type, accessed using a common name. Array in C Program Examples – This C Program example is for One Dimensional and Two Dimensional Array. #include<stdio.h> . . . Read more