Problem Solving Through Programming in C Week 3: Programming Assignments Jan-Jun 2022

 NPTEL PROGRAMMING ASSIGNMENTS

Problem Solving Through Programming in C

Week-03: Program-01

Due Date of Submission 2022-02-17, 23:59 IST
Write a C Program to calculates the area (floating point number with two decimal places) of a Circle given it’s radius (integer value). The value of Pi is 3.14.
[Marks for Week 3 Programming assignments will not be evaluated finally. This is for users to get familiar with programming in google course builder platform]


#include <stdio.h>
#define PI 3.14
void main()
{
    int radius;
    float area;
    /* Enter the radius of a circle */
    scanf("%d", &radius);

 

 

printf("Area of a circle = %5.2f\n", area);
}



Week-03: Program-02

Due Date of Submission 2022-02-17, 23:59 IST
Write a C program to check if a given Number is zero or Positive or Negative Using if...else statement.
[Week 3 programming assignments will not be considered for final evaluation]


#include <stdio.h>
int main()
{
    double number;
    scanf("%lf", &number); 

 

 




Week-03: Program-03

Due Date of Submission 2022-02-17, 23:59 IST
Write a C program to check whether a given number (integer) is Even or Odd.
[This program does not carry any marks.]


#include <stdio.h>
int main()
{
    int number;
    scanf("%d", &number);

 

 



Week-03: Program-04

Due Date of Submission 2022-02-17, 23:59 IST
Write a C Program to find the Largest Number (integer) among Three Numbers (integers) using IF and Logical && operator.
[Week 3 programming assignments will not be considered for final evaluation]


#include <stdio.h>
int main()
{
    int n1, n2, n3;
    scanf("%d %d %d", &n1, &n2, &n3);

 

 


Post a Comment (0)
Previous Post Next Post