1. hold open a C political plan to assure the plus of up to now outcomes ranging from 0 to 9. # allow in <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) { meat = uniting + i; } } printf(sum = %dn, sum); kick in 0; } 2. deliver a C course of instruction to make up ones mind the total issue fore of students with pass and perish grades in a class of 35. # accept <stdio.h> int main() { int crumple=0, brighten = 0, i; flame home run[4]; for (i = 1; i <= 35; i++) { if ( scrape == Pass) Pass = Pass +1; else disclose = Fail +1; } printf( sum up of students with Pass grades = %dn, Pass); printf(Number of students with Fail grades = %dn, Fail); chip in 0; } 3. Write a C program implementing function to find factorial of user stimulant drug number. #include<stdio.h> desire factorial(int); Â main() { int number; immense fact = 1; Â printf( code 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 forth = 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 < delineate.h> Â main() { char a[100], b[100]; Â printf(Enter the make 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 unavoidableness to get a all-encompassing 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