Posts

C program for Grading System

Image
Write a C program for Grading System to Calculate the Grade of a Student: Required Knowledge: C Basics, If-else 1 #include<stdio.h> 2 void main () 3 { 4 int marks ; 5 6 printf ( "Enter student marks:" ); 7 8 scanf ( "%d" ,& marks ); 9 10 if ( marks >= 80 ) 11 12 printf ( "Grade of student is A" ); 13 14 else if (( marks <= 79 )&&( marks >= 70 )) 15 16 printf ( "Grade of student is B" ); 17 18 else if (( marks <= 69 )&&( marks >= 60 )) 19 20 printf ( "Grade of student is C" ); 21 22 else if (( marks <= 59 )&&( marks >= 50 )) 23 24 printf ( "Grade of student is D" ); 25 26 else 27 28 printf ( "Grade of student is F" ); 29 } Output: Enjoy It......

Print square using Printf statement

Image
Write a C Program to  Print square using Printf statement Required Knowledge: Fundamentals of C,printf statement E:\University work\semester 1\fcp\blog.c 1 #include<stdio.h> 2 void main () 3 { 4 printf ( "The printing of Square through printf staement:\n\n" ); 5 6 printf ( " ********* \n" ); 7 printf ( " * * \n" ); 8 printf ( " * * \n" ); 9 printf ( " ********* \n" ); 10 }

C program check whether a number is even or odd

Image
Write a C program to check whether a number is even or odd. Example:   Enter no: 2  Output: No is even Enter no: 9  Output: No is odd Required knowledge: Fundamentals of C, Data types, Taking user input in C, IF-else 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 /*****************************************************   * C program to check a number is positive or not *   *****************************************************/ #include <stdio.h> void main() {      int num;        /* Reads number from user */      printf ( "Enter any number to check even or odd: " );      scanf ( "%d" , &num);             /* Check if the number is divisible by 2 then it is even */ ...

C program to check a number is positive or not

Image
Write a C program to check a number is positive or not. Example:   Enter no: 2  Output: No is positive  Enter no: -5  Output: No is negative  Required knowledge: Fundamentals of C, Data types, Taking user input in C, IF-else 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 /*****************************************************   * C program to check a number is positive or not *   *****************************************************/ #include <stdio.h> void main() {      int num;             /* Read number from user */      printf ( "Enter any number: " );      scanf ( "%d" , &num);             if (num > 0)      { ...