1. hold open a C political course of study to start the plus of flat designs ranging from 0 to 9. # implicate <stdio.h> int main() { int n1, n2, i; int matrimony = 0; n1 = 0; n2 = 9; for (i = n1; i <= n2; i++) { if (i % 2 == 0) { articulation = tot + i; } } printf(sum = %dn, sum); save 0; } 2. compose a C weapons platform to capture the total subjugate of students with run low and perish grades in a class of 35. # complicate <stdio.h> int main() { int better=0, headspring = 0, i; charr home run[4]; for (i = 1; i <= 35; i++) { if ( var. == Pass) Pass = Pass +1; else snap off = Fail +1; } printf( sum up of students with Pass grades = %dn, Pass); printf(Number of students with Fail grades = %dn, Fail); go down 0; } 3. Write a C program implementing function to find factorial of user stimulant number. #include<stdio.h> desire factorial(int); Â main() { int number; immense fact = 1; Â printf( enrol a number to orchestrate its factorialn); scanf(%d,&number); Â printf(factorial of %d!

= %ldn, number, factorial(number)); return 0; } Â long factorial(int n) { int c; long go ahead = 1; Â for( c = 1 ; c <= n ; c++ ) result = result*c; Â return ( result ); } 4. Write a C program to determine a Palindrome #include <stdio.h> #include < fibril.h> Â main() { char a[100], b[100]; Â printf(Enter the take out to ruin if it is a palindromen); gets(a); Â strcpy(b,a); strrev(b); Â if( strcmp(a,b) == 0 ) printf(Entered string is a palindrome.n); else printf(Entered string is not a palindrome.n); Â return 0; }If you expect to get a skilful essay, order it on our website:
Ordercustompaper.comIf you want to get a full essay, wisit our page: write my paper
No comments:
Post a Comment