This lab report summarizes an experiment on conditional operators, nested loops, and goto statements in C programming. It includes examples of using conditional operators to check student results, nested for loops to print a pattern of numbers, and the goto statement to repeat a number input. The report concludes the experiment taught important programming concepts like decision making and loop control flow. Homework problems provide additional examples of half pyramids, largest number comparisons, and nested loop patterns.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
It is an attempt to make the students of IT understand the basics of programming in C in a simple and easy way. Send your feedback for rectification/further development.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
It is an attempt to make the students of IT understand the basics of programming in C in a simple and easy way. Send your feedback for rectification/further development.
Highlighted key points on the following concepts of C Language,I/O Functions,Bitwise operators, preincrement operator,post increment operator ,storage class,functions,Sample Code Snippets
Operators and expressions in c languagetanmaymodi4
what is operator in c language
uses of operator in c language
syatax of operator in c language
program of operator in c language
what is expressions in c language
use of expressions in c language
syantax of expressions in c language
Highlighted key points on the following concepts of C Language,I/O Functions,Bitwise operators, preincrement operator,post increment operator ,storage class,functions,Sample Code Snippets
Operators and expressions in c languagetanmaymodi4
what is operator in c language
uses of operator in c language
syatax of operator in c language
program of operator in c language
what is expressions in c language
use of expressions in c language
syantax of expressions in c language
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
1. Lab Report
Course ID: TE-3702
Course Title:-Computer Application and Programming
(Sessional)
Experiment No. 05
Name:-Introduction to C conditional operator, nested loop
and go to statement.
Submitted by
Name :
ID :
Year and Semester :
Session :
Department :
Mahbubay Rabbani
175035
3/1
2018-19
Textile Engineering
Submitted to
Khawja Imran Masud
Lecturer
Department of CSE
Dhaka University of Engineering & Technology (DUET), Gazipur
2. Introduction:-
The conditional statements are the decision-making statements which
depends upon the output of the expression.
A loop inside another loop is called a nested loop.
The goto statement is a jump statement which is sometimes also called
unconditional jump statement. The goto statement can be used to jump
from anywhere to anywhere within a function.
Objectives:-
To know about conditional operator.
To know about nested loop.
To know about “goto” statement.
3. Conditional Operator
Conditional statements are decision-making statements that depend on
the output of the expression.
It is represented by two symbols that are '?' and ':'.
It works on three operands and that’s why it is also called the ternary
operator.
The behavior of the conditional operator is similar to the 'if-else'
statement as 'if-else' statement is also a decision-making statement. This
helps the ternary operator to think of it as a shorthand way to write a
statement.
The ternary operator works with the 3 following principles:-
The first is a comparison argument
The second is upon the results of true comparisons
The third results in a false comparison
4. Example:-
C program to check student result using conditional operator
Input:-
#include <stdio.h>
int main()
{
int mark;
printf("Enter the mark=");
scanf("%d", &mark);
puts(mark>=40?"Pass":"Fail");
return 0;
}
6. Nested loop
A loop inside another loop is called a nested loop.
The depth of nested loop depends on the complexity of a problem.
Using a for loop within another for loop is called nested for loop.
In nested for loop one or more statements can be included in the body of
the loop.
Example:-
Input:-
#include <stdio.h>
int main()
{
int a, b;
for(a=1;a<=5;a++)
{
for(b=1;b<=5;b++)
{
printf("%d ",b);
}
printf("n");
}
return 0;
}
8. go to statement
The goto statement is a jump statement which is sometimes called
unconditional jump statement. The goto statement can be used to jump
from anywhere to anywhere within a function. Here a label is used
which is a user-defined identifier and indicates the target statement. It
can be set anywhere in the C program above or below to goto statement.
Example
Write a C program that take the any double numbers between 1 to
10 and calculate the square root of that number.
input:-
#include<stdio.h>
int main()
{
double x,y;
read:
printf("Enter the double number between 1 to 10=");
scanf("%lf", &x);
if(x<0 || x>10)
goto read ;
y=sqrt(x);
printf( "%lf",y);
return 0;
}
10. Home task problems:-
Problem:-
Find the largest number among 3 input numbers using conditional
operator.
Input:-
# include <stdio.h>
int main()
{
int a, b, c, large ;
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
printf("Enter 3rd number=");
scanf("%d",&c);
large = a > b ? (a > c ? a : c) : (b > c ? b : c) ;
printf("The largest number is=%d",large);
}
12. Problem:-
Write a C program that display half Pyramid of *
*
* *
* * *
* * * *
* * * * *
Input:-
#include <stdio.h>
int main() {
int i, j, rows;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; i++)
{
for (j = 1; j <= i; j++)
{
printf("* ");
}
printf("n");
}
return 0;
}
20. Problem:-
Write a C program that display the pattern given below.
1
2 3
4 5 6
7 8 9 10
Input: 4
Input:-
#include <stdio.h>
int main()
{
int rows, i, j, number = 1;
printf("Enter the number of rows= ");
scanf("%d", &rows);
for (i=1; i<= rows; i++)
{
for (j=1; j<=i; j++)
{
printf("%d ", number);
++number;
}
printf("n");
}
22. Conclusion:- From this experiment we have learn about C conditional
operator, goto statement and nested loop which are very important for
programming. I think it will help me a lot in practical life